9 vector<MedPredictor *> predictors;
11 vector<float> weights;
17 vector<string> predictor_params;
18 string combiner_name =
"";
19 string combiner_params =
"";
29 void init_defaults() { predictors.clear(); weights.clear();
predictor_names.clear(); predictor_params.clear(); combiner_name =
""; combiner_params =
""; p_combine = 0; };
33 int Learn(
float *x,
float *y,
int nsamples,
int nftrs) { HMTHROW_AND_ERR(
"SimpleEnsemble: Learn(float *,...) not implemented, used the MedMat API instead\n"); };
34 int Learn(
float *x,
float *y,
const float *w,
int nsamples,
int nftrs) { HMTHROW_AND_ERR(
"SimpleEnsemble: Learn(float *,...) not implemented, used the MedMat API instead\n"); };
39 int Predict(
float *x,
float *&preds,
int nsamples,
int nftrs) { HMTHROW_AND_ERR(
"SimpleEnsemble: Predict(float *,...) not implemented, used the MedMat API instead\n"); };
40 int Predict(
float *x,
float *&preds,
int nsamples,
int nftrs,
int transposed_flag) { HMTHROW_AND_ERR(
"SimpleEnsemble: Predict(float *,...) not implemented, used the MedMat API instead\n"); };
42 int n_preds_per_sample() {
return n_preds; }
Logger.h - allowing logs with more control.
MedAlgo - APIs to different algorithms: Linear Models, RF, GBM, KNN, and more.
@ MODEL_SIMPLE_ENSEMBLE
to_use: "simple_ensemble" , give 1 or more models to train, and ensemble them with given weights from...
Definition MedAlgo.h:65
#define ADD_SERIALIZATION_FUNCS(...)
Definition SerializableObject.h:122
#define MEDSERIALIZE_SUPPORT(Type)
Definition SerializableObject.h:108
Base Interface for predictor.
Definition MedAlgo.h:78
MedPredictorTypes classifier_type
The Predicotr enum type.
Definition MedAlgo.h:80
Definition SimpleEnsemble.h:6
int set_params(map< string, string > &mapper)
Definition SimpleEnsemble.cpp:18
int learn(MedMat< float > &x, MedMat< float > &y, const vector< float > &wgts)
MedMat x,y : will transpose/normalize x,y if needed by algorithm The convention is that untransposed ...
Definition SimpleEnsemble.cpp:87
int Learn(float *x, float *y, const float *w, int nsamples, int nftrs)
Learn should be implemented for each model.
Definition SimpleEnsemble.h:34
vector< string > predictor_names
Parameters.
Definition SimpleEnsemble.h:16