Medial Code Documentation
Loading...
Searching...
No Matches
AggregatePredsPostProcessor.h
1#ifndef __AVERAGE_PREDS_POST_PROCESSOR_H__
2#define __AVERAGE_PREDS_POST_PROCESSOR_H__
3
4#include <vector>
6#include "PostProcessor.h"
7
8using namespace std;
9
14private:
15 MedPredictor *model_predictor = NULL;
16 FeatureProcessor *feature_processor = NULL;
17 vector<FeatureProcessor *> before_processors;
18 vector<FeatureProcessor *> after_processors;
19
20 MedModel *p_model;
21
22 void generate_matrix_till_feature_process(const MedFeatures &input_mat, MedFeatures &res) const;
23public:
26
31 bool print_missing_cnt;
32 //Add: batch_size, resample_cnt, store_mean (or median)
33
35
36 void get_input_fields(vector<Effected_Field> &fields) const;
37 void get_output_fields(vector<Effected_Field> &fields) const;
38
40 int init(map<string, string> &mapper);
41
43 void Learn(const MedFeatures &train_mat);
44 void Apply(MedFeatures &matrix);
45
46 void init_post_processor(MedModel& model);
47
48 void dprint(const string &pref) const;
49
51
52 ADD_CLASS_NAME(AggregatePredsPostProcessor)
53 ADD_SERIALIZATION_FUNCS(model_predictor, feature_processor, feature_processor_type,
55 before_processors, after_processors, print_missing_cnt)
56};
57
59
60#endif
Logger.h - allowing logs with more control.
#define ADD_SERIALIZATION_FUNCS(...)
Definition SerializableObject.h:122
#define MEDSERIALIZE_SUPPORT(Type)
Definition SerializableObject.h:108
Post processor to resample input and apply predictor multiple time with aggregation.
Definition AggregatePredsPostProcessor.h:13
void Learn(const MedFeatures &train_mat)
Learns from predictor and train_matrix (PostProcessor API)
Definition AggregatePredsPostProcessor.cpp:219
string feature_processor_args
the feature processor type
Definition AggregatePredsPostProcessor.h:25
bool use_median
if true will fetch median instead of mean
Definition AggregatePredsPostProcessor.h:28
int resample_cnt
how much to resample
Definition AggregatePredsPostProcessor.h:29
void get_output_fields(vector< Effected_Field > &fields) const
List of fields that are being effected by this post_processor.
Definition AggregatePredsPostProcessor.cpp:62
int batch_size
how many predictions to process together
Definition AggregatePredsPostProcessor.h:30
int init(map< string, string > &mapper)
Global init for general args in all explainers.
Definition AggregatePredsPostProcessor.cpp:19
void get_input_fields(vector< Effected_Field > &fields) const
List of fields that are used by this post_processor.
Definition AggregatePredsPostProcessor.cpp:56
string feature_processor_type
the feature processor type. if used from model, reffer with prefix MODEL::s where s is feature proces...
Definition AggregatePredsPostProcessor.h:24
bool force_cancel_imputations
if true will force removal of imputations
Definition AggregatePredsPostProcessor.h:27
Definition FeatureProcess.h:51
A class for holding features data as a virtual matrix
Definition MedFeatures.h:47
A model = repCleaner + featureGenerator + featureProcessor + MedPredictor.
Definition MedModel.h:56
Base Interface for predictor.
Definition MedAlgo.h:78
An Abstract PostProcessor class.
Definition PostProcessor.h:39
Definition StdDeque.h:58