Medial Code Documentation
|
IterativeImputer
A general strong imputer that does the following:
(1) Runs a simple stratified imputer
(2) Runs iterations completing values (from the least missing to the max missing) where:
(a) continuous values are calculated using a regressor
(b) categorial values (less than some bound) are calculated using a multi category classifier
(3) Repeats the process several times until it converges or until max_iters is reached.
More...
#include <IterativeImputer.h>
Public Member Functions | |
int | init (map< string, string > &mapper) |
The parsed fields from init command. | |
int | init_internals (MedFeatures &mfd) |
int | init_feature_info (MedFeatures &mfd, string feat_name) |
int | init_feature_info_update (MedFeatures &mfd, feature_info &fi) |
int | round_to_resolution (MedFeatures &mfd) |
int | round_arr (float *arr, int len, float resolution, float _min, float _max) |
int | learn_first_round (MedFeatures &mfd) |
int | learn_iteration (MedFeatures &mfd, int iter) |
int | apply_first_round (MedFeatures &mfd, bool learning) |
int | apply_iteration (MedFeatures &mfd, int iter) |
int | find_feats_to_learn_from (int f_idx) |
int | feats_for_pred_inds_to_names (feature_info &fi) |
int | Learn (MedFeatures &mfd) |
int | Apply (MedFeatures &mfd, bool learning) |
![]() | |
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 ¶m) |
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 | |
IterativeImputerParams | params |
vector< int > | train_idx |
vector< int > | test_idx |
vector< char > | is_train |
MedFeatures | learn_features_map |
unordered_set< int > | train_ids |
unordered_set< int > | test_ids |
vector< feature_info > | feats |
vector< FeatureImputer > | first_round_imputers |
vector< int > | predictors_order |
vector< vector< MedPredictor * > > | predictors |
IterativeImputer
A general strong imputer that does the following:
(1) Runs a simple stratified imputer
(2) Runs iterations completing values (from the least missing to the max missing) where:
(a) continuous values are calculated using a regressor
(b) categorial values (less than some bound) are calculated using a multi category classifier
(3) Repeats the process several times until it converges or until max_iters is reached.
|
inlinevirtual |
The parsed fields from init command.
Reimplemented from SerializableObject.
int IterativeImputer::init_feature_info | ( | MedFeatures & | mfd, |
string | feat_name | ||
) |
if (fi.n_missing > 0 && fi.n_with_values > 0)