1#ifndef __LABEL_PARAMS_H__
2#define __LABEL_PARAMS_H__
5#include <unordered_map>
16 bool has_default_mode;
17 bool has_default_range;
19 pair<float, float> default_intersection_range;
26 has_default_mode =
false;
27 has_default_range =
false;
30 default_intersection_range.first = 0; default_intersection_range.second = 0;
40 bool find(
const float x)
const {
52 HMTHROW_AND_ERR(
"Error - TimeWindowInteraction has already default\n");
53 has_default_mode =
true;
54 default_modes[0] = defaults_m[0];
55 default_modes[1] = defaults_m[1];
58 void set_default_range(
float min_range,
float max_range) {
59 default_intersection_range.first = min_range;
60 default_intersection_range.second = max_range;
61 has_default_range =
true;
64 bool get_inresection_range_cond(
float x,
float &min_range,
float &max_range)
const {
70 else if (has_default_range) {
71 min_range = default_intersection_range.first;
72 max_range = default_intersection_range.second;
78 void reset_for_init() {
79 has_default_mode =
false;
80 has_default_range =
false;
85 void init_from_string(
const string &init);
104 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:91
int init(map< string, string > &map)
init function
Definition LabelParams.cpp:65
int time_to
time window to - for labeling
Definition LabelParams.h:96
TimeWindowInteraction label_interaction_mode
the label interaction definition
Definition LabelParams.h:93
int time_from
time window from - for labeling
Definition LabelParams.h:95
TimeWindowInteraction censor_interaction_mode
the label interaction definition
Definition LabelParams.h:94
int censor_time_from
time window from - for censor registry
Definition LabelParams.h:98
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:100
int censor_time_to
time window to - for censor registry
Definition LabelParams.h:99
ConflictMode conflict_method
resolving conflicts
Definition LabelParams.h:97
Definition SerializableObject.h:32
A warpper class for initializing rules for time window interaction.
Definition LabelParams.h:14
unordered_map< float, TimeWindowMode[2]> interaction_mode
map from label value to interaction rules
Definition LabelParams.h:22
unordered_map< float, pair< float, float > > intersection_range_condition
intersection rate range with registry condition
Definition LabelParams.h:23