27 int Learn(
float *x,
float *y,
const float *w,
int nsamples,
int nftrs);
38 int Predict(
float *x,
float *&preds,
int nsamples,
int nftrs)
const;
43 MedBART() : _model(0, 0, 0, 0, tree_params) {
56 tree_params.
alpha = (float)0.95;
MedAlgo - APIs to different algorithms: Linear Models, RF, GBM, KNN, and more.
@ MODEL_BART
to_use:"bart" MedBART model using BART
Definition MedAlgo.h:63
#define ADD_SERIALIZATION_FUNCS(...)
Definition SerializableObject.h:122
#define MEDSERIALIZE_SUPPORT(Type)
Definition SerializableObject.h:108
Bayesian Additive Regression Trees.
Definition BART.h:300
a wrapper for BART class model.
Definition MedBART.h:11
void init_defaults()
an initialization for model
Definition MedBART.h:18
int set_params(map< string, string > &mapper)
Definition MedBART.cpp:27
MedBART()
a simple default ctor
Definition MedBART.h:43
int Predict(float *x, float *&preds, int nsamples, int nftrs) const
prediction on x vector which represents matrix
Definition MedBART.cpp:16
int Learn(float *x, float *y, const float *w, int nsamples, int nftrs)
learning on x vector which represents matrix.
Definition MedBART.cpp:6
Base Interface for predictor.
Definition MedAlgo.h:78
bool normalize_for_learn
True if need to normalize before learn.
Definition MedAlgo.h:87
bool transpose_for_predict
True if need to transpose before predict.
Definition MedAlgo.h:90
bool normalize_for_predict
True if need to normalize before predict.
Definition MedAlgo.h:91
bool normalize_y_for_learn
True if need to normalize labels before learn.
Definition MedAlgo.h:88
MedPredictorTypes classifier_type
The Predicotr enum type.
Definition MedAlgo.h:80
bool transpose_for_learn
True if need to transpose before learn.
Definition MedAlgo.h:86
bart tree parameters
Definition BART.h:111
float nu
the node-data dict params for sigma_i: sigma_i ~ IG(nu, mean_sigma*lambda/2)
Definition BART.h:123
float lambda
the node-data dict params for sigma_i: sigma_i ~ IG(mean_sigma/2, mean_sigma*lambda/2)
Definition BART.h:124
float k
the range for bandwidth interval
Definition BART.h:122
float beta
prior for tree structure: alpha * (1 + depth(node)) ^ -beta
Definition BART.h:116
int min_obs_in_node
minimal allowed observations in node
Definition BART.h:113
float alpha
prior for tree structure: alpha * (1 + depth(node)) ^ -beta
Definition BART.h:115