pub struct GradientBoostingClassifier { /* private fields */ }Expand description
Gradient boosting for 0/1 classification (log loss). Defaults match
scikit-learn’s GradientBoostingClassifier.
Implementations§
Source§impl GradientBoostingClassifier
impl GradientBoostingClassifier
pub fn new() -> Self
Sourcepub fn n_estimators(self, n: usize) -> Self
pub fn n_estimators(self, n: usize) -> Self
Number of boosting stages (default 100).
Sourcepub fn learning_rate(self, rate: f64) -> Self
pub fn learning_rate(self, rate: f64) -> Self
Shrinkage applied to every tree (default 0.1). Smaller values need more stages but usually generalise better.
Sourcepub fn max_depth(self, depth: Option<usize>) -> Self
pub fn max_depth(self, depth: Option<usize>) -> Self
Maximum depth of each tree (default 3); None for unlimited.
Sourcepub fn min_samples_split(self, n: usize) -> Self
pub fn min_samples_split(self, n: usize) -> Self
Minimum number of rows to split a node (default 2).
Sourcepub fn min_samples_leaf(self, n: usize) -> Self
pub fn min_samples_leaf(self, n: usize) -> Self
Minimum number of rows in each leaf (default 1).
Sourcepub fn max_features(self, m: MaxFeatures) -> Self
pub fn max_features(self, m: MaxFeatures) -> Self
Features considered per split (default: all).
Sourcepub fn subsample(self, fraction: f64) -> Self
pub fn subsample(self, fraction: f64) -> Self
Fraction of rows drawn (without replacement) for each stage (default 1.0); below 1 gives stochastic gradient boosting.
Sourcepub fn feature_importances(&self) -> Option<&Array1<f64>>
pub fn feature_importances(&self) -> Option<&Array1<f64>>
Total impurity reduction per feature over all trees (sums to one).
Trait Implementations§
Source§impl Classifier for GradientBoostingClassifier
impl Classifier for GradientBoostingClassifier
fn fit(&mut self, x: ArrayView2<'_, f64>, y: ArrayView1<'_, f64>) -> Result<()>
fn predict_proba(&self, x: ArrayView2<'_, f64>) -> Result<Array1<f64>>
fn fresh(&self) -> Box<dyn Classifier>
Source§impl Clone for GradientBoostingClassifier
impl Clone for GradientBoostingClassifier
Source§impl Debug for GradientBoostingClassifier
impl Debug for GradientBoostingClassifier
Auto Trait Implementations§
impl Freeze for GradientBoostingClassifier
impl RefUnwindSafe for GradientBoostingClassifier
impl Send for GradientBoostingClassifier
impl Sync for GradientBoostingClassifier
impl Unpin for GradientBoostingClassifier
impl UnsafeUnpin for GradientBoostingClassifier
impl UnwindSafe for GradientBoostingClassifier
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more