Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
MedBootstrapResult Class Reference

A wrapper class which contains the MedBootstrap object and the results for later quering the scores for preformance details. More...

#include <MedBootstrap.h>

Inheritance diagram for MedBootstrapResult:
SerializableObject

Public Member Functions

void bootstrap (MedFeatures &features, map< int, map< string, map< string, float > > > *results_per_split=NULL, with_registry_args *registry_args=NULL)
 run the bootstrap - look at MedBootstrap.bootstrap documentition and stores the results in bootstrap_results
 
void bootstrap (MedSamples &samples, map< string, vector< float > > &additional_info, map< int, map< string, map< string, float > > > *results_per_split=NULL, with_registry_args *registry_args=NULL)
 run the bootstrap - look at MedBootstrap.bootstrap documentition and stores the results in bootstrap_results
 
void bootstrap (MedSamples &samples, const string &rep_path, map< int, map< string, map< string, float > > > *results_per_split=NULL, with_registry_args *registry_args=NULL)
 run the bootstrap - look at MedBootstrap.bootstrap documentition and stores the results in bootstrap_results
 
void find_working_points (const map< string, float > &bootstrap_cohort, vector< float > &sens_points, vector< float > &pr_points)
 searches for the sensitivty(sens) and positive rate(pr) in the sepcific bootstrap_cohort results which is map from measure name to it's value.
 
void explore_score (float score, map< string, float > &score_measurements, const string &string_cohort="All", float max_search_range=0.1)
 searches for sepcific score value the corresonding measurments in that working point based on the bootstrap result.
 
void write_results_to_text_file (const string &path, bool pivot_format=true, const string &run_id="")
 writes the results to file with TAB delimeted manner.
 
void read_results_to_text_file (const string &path, bool pivot_format=true)
 reads the results from file with TAB delimeted manner.
 
- Public Member Functions inherited from SerializableObject
virtual int version () const
 Relevant for serializations.
 
virtual string my_class_name () const
 For better handling of serializations it is highly recommended that each SerializableObject inheriting class will implement the next method.
 
virtual void serialized_fields_name (vector< string > &field_names) const
 The names of the serialized fields.
 
virtual void * new_polymorphic (string derived_name)
 for polymorphic classes that want to be able to serialize/deserialize a pointer * to the derived class given its type one needs to implement this function to return a new to the derived class given its type (as in my_type)
 
virtual void pre_serialization ()
 
virtual void post_deserialization ()
 
virtual size_t get_size ()
 Gets bytes sizes for serializations.
 
virtual size_t serialize (unsigned char *blob)
 Serialiazing object to blob memory. return number ob bytes wrote to memory.
 
virtual size_t deserialize (unsigned char *blob)
 Deserialiazing blob to object. returns number of bytes read.
 
size_t serialize_vec (vector< unsigned char > &blob)
 
size_t deserialize_vec (vector< unsigned char > &blob)
 
virtual size_t serialize (vector< unsigned char > &blob)
 
virtual size_t deserialize (vector< unsigned char > &blob)
 
virtual int read_from_file (const string &fname)
 read and deserialize model
 
virtual int write_to_file (const string &fname)
 serialize model and write to file
 
virtual int read_from_file_unsafe (const string &fname)
 read and deserialize model without checking version number - unsafe read
 
int init_from_string (string init_string)
 Init from string.
 
int init_params_from_file (string init_file)
 
int init_param_from_file (string file_str, string &param)
 
virtual int init (map< string, string > &map)
 Virtual to init object from parsed fields.
 
int update_from_string (const string &init_string)
 
virtual int update (map< string, string > &map)
 Virtual to update object from parsed fields.
 
virtual string object_json () const
 

Data Fields

MedBootstrap bootstrap_params
 The boostrap parameters.
 
map< string, map< string, float > > bootstrap_results
 The bootstrap results.
 

Detailed Description

A wrapper class which contains the MedBootstrap object and the results for later quering the scores for preformance details.

Member Function Documentation

◆ explore_score()

void MedBootstrapResult::explore_score ( float  score,
map< string, float > &  score_measurements,
const string &  string_cohort = "All",
float  max_search_range = 0.1 
)

searches for sepcific score value the corresonding measurments in that working point based on the bootstrap result.

you need to run or load object with bootstrap_results which is not empty.

Parameters
scorethe score that defines the working point
string_cohortthe cohort name to search for the measurments with
max_search_rangemax interval for searching working points measurements in the bootstrap. if the working point in the bootstrap results are too far away from the score working point it will not return any result
Returns
updates score_measurements with the bootstrap corresponding measurements

◆ find_working_points()

void MedBootstrapResult::find_working_points ( const map< string, float > &  bootstrap_cohort,
vector< float > &  sens_points,
vector< float > &  pr_points 
)

searches for the sensitivty(sens) and positive rate(pr) in the sepcific bootstrap_cohort results which is map from measure name to it's value.

the bootstrap_cohort results is in binary/categorial (which working points are defined @SCORE)

Returns
updates sens_points, pr_points vectors for SCORE defined working points bootstrap

◆ read_results_to_text_file()

void MedBootstrapResult::read_results_to_text_file ( const string &  path,
bool  pivot_format = true 
)

reads the results from file with TAB delimeted manner.

you can also read pivot format

◆ write_results_to_text_file()

void MedBootstrapResult::write_results_to_text_file ( const string &  path,
bool  pivot_format = true,
const string &  run_id = "" 
)

writes the results to file with TAB delimeted manner.

you can also pivot the format

Field Documentation

◆ bootstrap_results

map<string, map<string, float> > MedBootstrapResult::bootstrap_results

The bootstrap results.

map from cohort_name to all cohort measurements(a map). each measurement is key,value in the map from measurement name to it's value


The documentation for this class was generated from the following files: