1#ifndef __LABEL_PARAMS_H__
2#define __LABEL_PARAMS_H__
5#include <unordered_map>
17 bool has_default_mode;
18 bool has_default_range;
20 pair<float, float> default_intersection_range;
27 has_default_mode =
false;
28 has_default_range =
false;
31 default_intersection_range.first = 0; default_intersection_range.second = 0;
41 bool find(
const float x)
const {
53 HMTHROW_AND_ERR(
"Error - TimeWindowInteraction has already default\n");
54 has_default_mode =
true;
55 default_modes[0] = defaults_m[0];
56 default_modes[1] = defaults_m[1];
59 void set_default_range(
float min_range,
float max_range) {
60 default_intersection_range.first = min_range;
61 default_intersection_range.second = max_range;
62 has_default_range =
true;
65 bool get_inresection_range_cond(
float x,
float &min_range,
float &max_range)
const {
71 else if (has_default_range) {
72 min_range = default_intersection_range.first;
73 max_range = default_intersection_range.second;
79 void reset_for_init() {
80 has_default_mode =
false;
81 has_default_range =
false;
86 void init_from_string(
const string &init);
105 int init(map<string, string>& map);
Logger.h - allowing logs with more control.
registry methods over MedRegistry Object
TimeWindowMode
Definition MedEnums.h:25
@ All_
"all" - takes all not testing for anything
ConflictMode
Definition MedEnums.h:12
An Abstract class that can be serialized and written/read from file.
Parameters for lableing strategy on MedRegistry for given time window.
Definition LabelParams.h:92
int init(map< string, string > &map)
init function
Definition LabelParams.cpp:65
int time_to
time window to - for labeling
Definition LabelParams.h:97
TimeWindowInteraction label_interaction_mode
the label interaction definition
Definition LabelParams.h:94
int time_from
time window from - for labeling
Definition LabelParams.h:96
TimeWindowInteraction censor_interaction_mode
the label interaction definition
Definition LabelParams.h:95
int censor_time_from
time window from - for censor registry
Definition LabelParams.h:99
bool treat_0_class_as_other_classes
used to define the way outcome time is set to 0 class. in case control should be false,...
Definition LabelParams.h:101
int censor_time_to
time window to - for censor registry
Definition LabelParams.h:100
ConflictMode conflict_method
resolving conflicts
Definition LabelParams.h:98
Definition SerializableObject.h:31
A warpper class for initializing rules for time window interaction.
Definition LabelParams.h:15
unordered_map< float, std::array< TimeWindowMode, 2 > > interaction_mode
map from label value to interaction rules
Definition LabelParams.h:23
unordered_map< float, pair< float, float > > intersection_range_condition
intersection rate range with registry condition
Definition LabelParams.h:24