pub struct GradientBoostingClassifier {
pub n_estimators: usize,
pub learning_rate: f64,
pub max_depth: Option<usize>,
pub min_samples_split: usize,
pub min_samples_leaf: usize,
pub subsample: f64,
pub seed: u64,
}Expand description
Gradient boosting classifier parameters (unfitted state).
For binary classification, fits trees to the negative gradient of the log loss (logistic regression loss). For multi-class (>2 classes), uses a one-vs-rest strategy with separate sets of trees for each class.
Fields§
§n_estimators: usizeNumber of boosting rounds (trees per class for multi-class).
learning_rate: f64Shrinkage applied to each tree’s contribution.
max_depth: Option<usize>Maximum depth of each tree.
min_samples_split: usizeMinimum samples required to split a node.
min_samples_leaf: usizeMinimum samples required in a leaf node.
subsample: f64Fraction of training samples used per tree.
seed: u64Random seed for reproducibility.
Implementations§
Source§impl GradientBoostingClassifier
impl GradientBoostingClassifier
Sourcepub fn with_n_estimators(self, n_estimators: usize) -> Self
pub fn with_n_estimators(self, n_estimators: usize) -> Self
Set the number of boosting rounds.
Sourcepub fn with_learning_rate(self, learning_rate: f64) -> Self
pub fn with_learning_rate(self, learning_rate: f64) -> Self
Set the learning rate (shrinkage).
Sourcepub fn with_max_depth(self, max_depth: Option<usize>) -> Self
pub fn with_max_depth(self, max_depth: Option<usize>) -> Self
Set the maximum depth of each tree.
Sourcepub fn with_min_samples_split(self, min_samples_split: usize) -> Self
pub fn with_min_samples_split(self, min_samples_split: usize) -> Self
Set the minimum number of samples required to split a node.
Sourcepub fn with_min_samples_leaf(self, min_samples_leaf: usize) -> Self
pub fn with_min_samples_leaf(self, min_samples_leaf: usize) -> Self
Set the minimum number of samples required in a leaf node.
Sourcepub fn with_subsample(self, subsample: f64) -> Self
pub fn with_subsample(self, subsample: f64) -> Self
Set the fraction of samples used per boosting round.
Trait Implementations§
Source§impl Clone for GradientBoostingClassifier
impl Clone for GradientBoostingClassifier
Source§fn clone(&self) -> GradientBoostingClassifier
fn clone(&self) -> GradientBoostingClassifier
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GradientBoostingClassifier
impl Debug for GradientBoostingClassifier
Source§impl Default for GradientBoostingClassifier
impl Default for GradientBoostingClassifier
Source§impl<'de> Deserialize<'de> for GradientBoostingClassifier
impl<'de> Deserialize<'de> for GradientBoostingClassifier
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>,
Source§impl<F: Float> Fit<F> for GradientBoostingClassifier
impl<F: Float> Fit<F> 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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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