|
Medial Code Documentation
|
Bayesian Additive Regression Trees. More...
#include <BART.h>
Public Member Functions | |
| void | learn (const vector< float > &x, const vector< float > &y) |
| learning on x vector which represents matrix. | |
| void | predict (const vector< float > &x, int nSamples, vector< float > &scores) const |
| prediction on x vector which represents matrix | |
| BART (int ntrees, int iterations, int burn_cnt, int restart_cnt, bart_params &tree_pr) | |
| a simple default ctor | |
| void | operator= (const BART &other) |
| a simple assignment operator to shallow copy all BART model with all trees. | |
| ~BART () | |
| a dctor to free all tree memory | |
Data Fields | |
| int | ntrees |
| The nubmer of trees/restarts. | |
| int | iter_count |
| the number of steps to call next_gen_tree for each tree | |
| int | burn_count |
| the burn count | |
| int | restart_count |
| number of restarts | |
| bart_params | tree_params |
| additional tree parameters | |
Bayesian Additive Regression Trees.
A Monte-Carlo-Markov-Chain process to create trees based on bayesian assumtions
to reach maximum likelihood of tree based on the observations with Metropolis_Hastings algorithm.
It's very usefull for casual inference:
In 2016 at Atlantic Casual Infernce Confernce - 1st place in data competition
| void BART::learn | ( | const vector< float > & | x, |
| const vector< float > & | y | ||
| ) |
learning on x vector which represents matrix.
y is the labels
| x | a vector which represnts matrix. the data is ordered by observations. we first see first observation all features and than second obseravtion all features... |
| y | labels vector for each observation in x |
|
inline |
a simple assignment operator to shallow copy all BART model with all trees.
not allocating new memory for trees. pointing to same objects
| void BART::predict | ( | const vector< float > & | x, |
| int | nSamples, | ||
| vector< float > & | scores | ||
| ) | const |
prediction on x vector which represents matrix
| x | a vector which represnts matrix. the data is ordered by observations. we first see first observation all features and than second obseravtion all features... |
| nSamples | the number of samples in x |
scores the result scores for each observation