pub struct RegressionTree { /* private fields */ }Expand description
A least-squares regression tree whose leaves hold Newton steps Σr / Σw (the mean residual
when every weight is one).
Implementations§
Source§impl RegressionTree
impl RegressionTree
pub fn new(max_depth: usize, min_samples_leaf: usize) -> Self
Sourcepub fn fit(
&mut self,
x: &[Vec<f64>],
r: &[f64],
w: &[f64],
samples: &[usize],
importances: &mut [f64],
)
pub fn fit( &mut self, x: &[Vec<f64>], r: &[f64], w: &[f64], samples: &[usize], importances: &mut [f64], )
Fits the tree on rows samples of x to residuals r with Newton weights w; adds each
split’s squared-error reduction to importances.
pub fn predict_row(&self, row: &[f64]) -> f64
Trait Implementations§
Source§impl Clone for RegressionTree
impl Clone for RegressionTree
Auto Trait Implementations§
impl Freeze for RegressionTree
impl RefUnwindSafe for RegressionTree
impl Send for RegressionTree
impl Sync for RegressionTree
impl Unpin for RegressionTree
impl UnsafeUnpin for RegressionTree
impl UnwindSafe for RegressionTree
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