Medial Code Documentation
Loading...
Searching...
No Matches
Functions
medial::sampling Namespace Reference

sampling namespace More...

Functions

bool in_time_window_simple (int pred_date, int start_time, int end_time, bool reverse, TimeWindowMode mode)
 checks for time range intersection
 
bool in_time_window (int pred_date, const MedRegistryRecord *r_outcome, const vector< const MedRegistryRecord * > &r_censor, int time_from, int time_to, int censor_time_from, int censor_time_to, const TimeWindowMode mode[2], const TimeWindowMode mode_prediction[2])
 checks for time range intersection
 
bool in_time_window (int pred_date, const MedRegistryRecord *r_outcome, const vector< const MedRegistryRecord * > &r_censor, int time_from, int time_to, int censor_time_from, int censor_time_to, const TimeWindowInteraction &mode_outcome, const TimeWindowInteraction &mode_censoring, bool filter_no_censor=true)
 checks for time range intersection
 
void get_label_for_sample (int pred_time, const vector< const MedRegistryRecord * > &pid_records, const vector< const MedRegistryRecord * > &r_censor, int time_from, int time_to, int censor_time_from, int censor_time_to, const TimeWindowInteraction &mode_outcome, const TimeWindowInteraction &mode_censoring, ConflictMode conflict_mode, vector< MedSample > &idSamples, int &no_rule_found, int &conflict_count, int &done_count, bool treat_0_class_as_other_classes, bool filter_no_censor=true, bool show_conflicts=false)
 checks for time range intersection
 

Detailed Description

sampling namespace

Function Documentation

◆ get_label_for_sample()

void medial::sampling::get_label_for_sample ( int  pred_time,
const vector< const MedRegistryRecord * > &  pid_records,
const vector< const MedRegistryRecord * > &  r_censor,
int  time_from,
int  time_to,
int  censor_time_from,
int  censor_time_to,
const TimeWindowInteraction mode_outcome,
const TimeWindowInteraction mode_censoring,
ConflictMode  conflict_mode,
vector< MedSample > &  idSamples,
int &  no_rule_found,
int &  conflict_count,
int &  done_count,
bool  treat_0_class_as_other_classes,
bool  filter_no_censor = true,
bool  show_conflicts = false 
)

checks for time range intersection

Parameters
pred_timeprediction time
pid_recordsthe registry records of patient which are candidated for labeling
r_censorall the patient registry records for censoring. if empty - no censoring
time_fromthe time window from - to check with outcome registry
time_tothe time window to - to check with outcome registry
censor_time_fromthe time window from - to check with censoring registry
censor_time_tothe time window to - to check with censoring registry
mode_outcomethe intersection method test for outcome
mode_censoringthe intersection method test for censoring
filter_no_censorwhat to do when no censoring record options are given
Returns
If has intersection with time window

◆ in_time_window() [1/2]

bool medial::sampling::in_time_window ( int  pred_date,
const MedRegistryRecord r_outcome,
const vector< const MedRegistryRecord * > &  r_censor,
int  time_from,
int  time_to,
int  censor_time_from,
int  censor_time_to,
const TimeWindowInteraction mode_outcome,
const TimeWindowInteraction mode_censoring,
bool  filter_no_censor = true 
)

checks for time range intersection

Parameters
pred_dateprediction time
r_outcomethe registry record for label
r_censorall the patient registry records for censoring. if empty - no censoring
time_fromthe time window from - to check with outcome registry
time_tothe time window to - to check with outcome registry
censor_time_fromthe time window from - to check with censoring registry
censor_time_tothe time window to - to check with censoring registry
mode_outcomethe intersection method test for outcome
mode_censoringthe intersection method test for censoring
filter_no_censorwhat to do when no censoring record options are given
Returns
If has intersection with time window

◆ in_time_window() [2/2]

bool medial::sampling::in_time_window ( int  pred_date,
const MedRegistryRecord r_outcome,
const vector< const MedRegistryRecord * > &  r_censor,
int  time_from,
int  time_to,
int  censor_time_from,
int  censor_time_to,
const TimeWindowMode  mode[2],
const TimeWindowMode  mode_prediction[2] 
)

checks for time range intersection

Parameters
pred_dateprediction time
r_outcomethe registry record for label
r_censorall the patient registry records for censoring. if empty - no censoring
time_fromthe time window from - to check with outcome registry
time_tothe time window to - to check with outcome registry
censor_time_fromthe time window from - to check with censoring registry
censor_time_tothe time window to - to check with censoring registry
modethe intersection method test for outcome
mode_predictionthe intersection method test for censoring
Returns
If has intersection with time window

◆ in_time_window_simple()

bool medial::sampling::in_time_window_simple ( int  pred_date,
int  start_time,
int  end_time,
bool  reverse,
TimeWindowMode  mode 
)

checks for time range intersection

Parameters
pred_dateprediction time
start_timestart time of window
end_timeend time of window
reverseIf we are in reverse window - looking backward in time
modethe intersection method test
Returns
If has intersection with time window