pub struct XGBoostClassifier {
pub n_estimators: usize,
pub learning_rate: f32,
pub max_depth: usize,
pub min_child_weight: f32,
pub subsample: f32,
pub colsample_bytree: f32,
pub reg_lambda: f32,
pub reg_alpha: f32,
pub gamma: f32,
/* private fields */
}Expand description
XGBoost-style Gradient Boosting
Features:
- Regularized learning objective (L1 and L2)
- Column (feature) subsampling
- Shrinkage (learning rate)
- Tree pruning with max_depth
- Histogram-based split finding
Fields§
§n_estimators: usize§learning_rate: f32§max_depth: usize§min_child_weight: f32§subsample: f32§colsample_bytree: f32§reg_lambda: f32§reg_alpha: f32§gamma: f32Implementations§
Source§impl XGBoostClassifier
impl XGBoostClassifier
pub fn new(n_estimators: usize) -> Self
pub fn learning_rate(self, lr: f32) -> Self
pub fn max_depth(self, depth: usize) -> Self
pub fn subsample(self, ratio: f32) -> Self
pub fn colsample_bytree(self, ratio: f32) -> Self
pub fn reg_lambda(self, lambda: f32) -> Self
pub fn reg_alpha(self, alpha: f32) -> Self
pub fn fit(&mut self, x: &Tensor, y: &Tensor)
pub fn predict(&self, x: &Tensor) -> Tensor
pub fn predict_proba(&self, x: &Tensor) -> Tensor
Auto Trait Implementations§
impl Freeze for XGBoostClassifier
impl RefUnwindSafe for XGBoostClassifier
impl Send for XGBoostClassifier
impl Sync for XGBoostClassifier
impl Unpin for XGBoostClassifier
impl UnwindSafe for XGBoostClassifier
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
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