Medial Code Documentation
Loading...
Searching...
No Matches
MedSpecificGroupModels.h
1#pragma once
3
7public:
8 // Model
9
10 int nsamples;
11 int nftrs;
12 /*double **x;
13 double **y;
14 float *w;
15 */
16
17 // Function
20
21 int Learn(float *x, float *y, const float *w, int nsamples, int nftrs);
22 int Predict(float *x, float *&preds, int nsamples, int nftrs) const;
23 MedSpecificGroupModels *clone() const;
24
25 ADD_CLASS_NAME(MedSpecificGroupModels)
27
28 // void print(FILE *fp, const string& prefix) ;
29 // Parameters
30 void set_predictors(const vector<MedPredictor *> &predictors); //for each group index
31 void set_group_selection(int featNum, const vector<float> &feat_ths);
32 MedPredictor *get_model(int ind);
33 int model_cnt() const;
34private:
35 vector<MedPredictor *> predictors;
36 int featNum;
37 vector<float> feat_ths;
38 int selectPredictor(const float *x) const; //retrieve predictor index
39};
40
41
MedAlgo - APIs to different algorithms: Linear Models, RF, GBM, KNN, and more.
#define ADD_SERIALIZATION_FUNCS(...)
Definition SerializableObject.h:122
#define MEDSERIALIZE_SUPPORT(Type)
Definition SerializableObject.h:108
Base Interface for predictor.
Definition MedAlgo.h:78
int features_count
The model features count used in Learn, to validate when caling predict.
Definition MedAlgo.h:96
MedPredictorTypes classifier_type
The Predicotr enum type.
Definition MedAlgo.h:80
vector< string > model_features
The model features used in Learn, to validate when caling predict.
Definition MedAlgo.h:93
wrapper for MedPredictor for certian groups - routes the input to correct model group.
Definition MedSpecificGroupModels.h:6
int Learn(float *x, float *y, const float *w, int nsamples, int nftrs)
Learn should be implemented for each model.
Definition MedSpecificGroupModels.cpp:44
int Predict(float *x, float *&preds, int nsamples, int nftrs) const
Predict should be implemented for each model.
Definition MedSpecificGroupModels.cpp:70