37 double predict_sample(
TreeBoosterNode *node, std::span<double> &sample);
69 void copy_hyperparams(
const TreeBooster &other)
noexcept;
88 double weight_decay = 0.0,
89 double reg_lambda = 1.0,
struct arena_view arena_view_t
2d array abstraction
Definition Matrix.h:43
A node used in a TreeBooster used for gather and storing information about the decision making proces...
Definition TreeBoosterNode.h:25
int _max_depth
Definition TreeBooster.h:29
double _weight_decay
Definition TreeBooster.h:33
arena_t * _arena
Definition TreeBooster.h:34
TreeBoosterNode * _root
Definition TreeBooster.h:28
TreeBooster & operator=(TreeBooster &&other) noexcept
Move equals operator.
virtual void fit(DataMatrix &X, std::shared_ptr< CNum::Data::Shelf[]> shelves, double *g, double *h, DataPartition &partition)=0
virtual ~TreeBooster()
Destructor.
int _min_samples
Definition TreeBooster.h:30
TreeBooster(TreeBooster &&other) noexcept
Move constructor.
void set_root(TreeBoosterNode *root)
Set the root of the tree.
TreeBooster & operator=(const TreeBooster &other) noexcept
Copy equals operator.
TreeBooster(const TreeBooster &other) noexcept
Copy constructor.
static void histogram_subtraction(const arena_view_t &parent_hist_view, arena_view_t &small_hist_view, arena_view_t &large_hist_view)
Subtract a parent histogram from "small" histogram for histogram caching.
TreeBooster(arena_t *a=nullptr, int md=5, int ms=3, double weight_decay=0.0, double reg_lambda=1.0, double gamma=0.0)
Overloaded default constructor.
std::string to_json()
Save tree data in json encoded string.
arena_view_t init_hist_view(size_t n_data_cols)
Allocate space for histograms on the arena.
double _gamma
Definition TreeBooster.h:32
double _reg_lambda
Definition TreeBooster.h:31
static size_t partition_data(const CNum::DataStructs::Matrix< int > &X, double *g, double *h, size_t feat, uint8_t bin, const DataPartition &partition)
Partition idx array, g, and h based on a split to make each nodes' slice of the dataset contigous.
CNum::DataStructs::Matrix< double > predict(CNum::DataStructs::Matrix< double > &data)
Inference (making predictions) on tabular data.
Tree-based models.
Definition GBModel.h:11
std::variant< CNum::DataStructs::Matrix< int >, CNum::DataStructs::Matrix< double > > DataMatrix
Definition TreeDefs.h:23
Contains bins and the ranges of values they represent.
Definition Data.h:31
A data partition for the set of samples a tree node has to work with during the tree building process...
Definition TreeDefs.h:39