11 using Ptr = std::unique_ptr<BootstrapTree>;
Contiguous-block representation of grouped observations.
Definition GroupPartition.hpp:42
pcg32 RNG
Definition Stats.hpp:19
Eigen::Matrix< Feature, Eigen::Dynamic, Eigen::Dynamic > FeatureMatrix
Dynamic-size matrix of feature values.
Definition Types.hpp:24
Eigen::Matrix< Response, Eigen::Dynamic, 1 > ResponseVector
Dynamic-size column vector of group labels.
Definition Types.hpp:29
Definition Benchmark.hpp:22
BootstrapTree(TreeNode::Ptr root, TrainingSpec::Ptr spec, std::vector< int > samp)
types::ResponseVector predict_oob(types::FeatureMatrix const &x, std::vector< int > const &row_idx) const
Predict for a subset of rows (e.g. OOB indices).
static Ptr train(TrainingSpec::Ptr const &training_spec, types::FeatureMatrix const &x, stats::GroupPartition const &group_spec, stats::RNG &rng)
Train a bootstrap tree.
Tree(TreeNode::Ptr root, TrainingSpec::Ptr training_spec)
std::unique_ptr< BootstrapTree > Ptr
Definition BootstrapTree.hpp:11
std::vector< int > oob_indices(int n_total) const
Indices of observations not in the bootstrap sample.
std::vector< int > sample_indices
Definition BootstrapTree.hpp:30
TrainingSpec::Ptr training_spec
Training specification used to build this model.
Definition Model.hpp:45
std::shared_ptr< TrainingSpec > Ptr
Definition TrainingSpec.hpp:41
std::unique_ptr< TreeNode > Ptr
Definition TreeNode.hpp:20
TreeNode::Ptr root
Root node of the tree.
Definition Tree.hpp:62
Tree(TreeNode::Ptr root, TrainingSpec::Ptr training_spec)