7enum MedMultiClassType {
8 MULTI_CLASS_ONE_VS_ALL = 1,
15 MedMultiClassType multi_class_type;
17 vector<float> class_values;
18 void *internal_params;
26 vector<MedPredictor *> internal_predictors;
33 int init(
void *params);
38 int init_classifiers();
39 int init_classifier(
int index);
41 int Learn(
float *x,
float *y,
int nsamples,
int nftrs);
42 int Learn(
float *x,
float *y,
const float *w,
int nsamples,
int nftrs);
44 int Predict(
float *x,
float *&preds,
int nsamples,
int nftrs)
const;
47 void print(FILE *fp,
const string& prefix,
int level = 0)
const;
MedAlgo - APIs to different algorithms: Linear Models, RF, GBM, KNN, and more.
MedPredictorTypes
Definition MedAlgo.h:44
#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 MedMultiClass.h:12
Definition MedMultiClass.h:23
int n_preds_per_sample() const
Number of predictions per sample. typically 1 - but some models return several per sample (for exampl...
Definition MedMultiClass.cpp:171
int Predict(float *x, float *&preds, int nsamples, int nftrs) const
Predict should be implemented for each model.
Definition MedMultiClass.cpp:180