pub struct Tree {
pub nodes: Vec<Node>,
}Fields§
§nodes: Vec<Node>Implementations§
source§impl Tree
impl Tree
pub fn new() -> Self
pub fn fit<T: Splitter>( &mut self, data: &Matrix<'_, u16>, index: Vec<usize>, cuts: &JaggedMatrix<f64>, grad: &[f32], hess: &[f32], splitter: &T, max_leaves: usize, max_depth: usize, parallel: bool, sample_method: &SampleMethod, grow_policy: &GrowPolicy )
pub fn predict_contributions_row_midpoint_difference( &self, row: &[f64], contribs: &mut [f64], missing: &f64 )
pub fn predict_contributions_midpoint_difference( &self, data: &Matrix<'_, f64>, contribs: &mut [f64], parallel: bool, missing: &f64 )
pub fn predict_contributions_row_branch_difference( &self, row: &[f64], contribs: &mut [f64], missing: &f64 )
pub fn predict_contributions_branch_difference( &self, data: &Matrix<'_, f64>, contribs: &mut [f64], parallel: bool, missing: &f64 )
pub fn predict_contributions_row_weight( &self, row: &[f64], contribs: &mut [f64], missing: &f64 )
pub fn predict_contributions_weight( &self, data: &Matrix<'_, f64>, contribs: &mut [f64], parallel: bool, missing: &f64 )
sourcepub fn predict_contributions_row_average(
&self,
row: &[f64],
contribs: &mut [f64],
weights: &[f64],
missing: &f64
)
pub fn predict_contributions_row_average( &self, row: &[f64], contribs: &mut [f64], weights: &[f64], missing: &f64 )
This is the method that XGBoost uses.
pub fn predict_contributions_average( &self, data: &Matrix<'_, f64>, contribs: &mut [f64], weights: &[f64], parallel: bool, missing: &f64 )
pub fn predict_row_from_row_slice(&self, row: &[f64], missing: &f64) -> f64
pub fn predict( &self, data: &Matrix<'_, f64>, parallel: bool, missing: &f64 ) -> Vec<f64>
pub fn value_partial_dependence( &self, feature: usize, value: f64, missing: &f64 ) -> f64
pub fn distribute_leaf_weights(&self) -> Vec<f64>
Trait Implementations§
source§impl<'de> Deserialize<'de> for Tree
impl<'de> Deserialize<'de> for Tree
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Tree
impl Send for Tree
impl Sync for Tree
impl Unpin for Tree
impl UnwindSafe for Tree
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more