pub struct AdaBoostClassifier<State = Untrained> { /* private fields */ }Expand description
AdaBoost Classifier
AdaBoost is a meta-algorithm that can be used in conjunction with many other types of learning algorithms to improve performance. The key idea is to fit a sequence of weak learners on repeatedly modified versions of the data.
Implementations§
Source§impl AdaBoostClassifier<Untrained>
impl AdaBoostClassifier<Untrained>
Sourcepub fn n_estimators(self, n_estimators: usize) -> Self
pub fn n_estimators(self, n_estimators: usize) -> Self
Set the number of boosting iterations
Sourcepub fn learning_rate(self, learning_rate: Float) -> Self
pub fn learning_rate(self, learning_rate: Float) -> Self
Set the learning rate
Sourcepub fn random_state(self, random_state: u64) -> Self
pub fn random_state(self, random_state: u64) -> Self
Set the random state for reproducible results
Sourcepub fn algorithm(self, algorithm: AdaBoostAlgorithm) -> Self
pub fn algorithm(self, algorithm: AdaBoostAlgorithm) -> Self
Set the algorithm variant
Sourcepub fn with_samme_r(self) -> Self
pub fn with_samme_r(self) -> Self
Use the SAMME.R algorithm variant
Sourcepub fn with_gentle(self) -> Self
pub fn with_gentle(self) -> Self
Use the Gentle AdaBoost algorithm variant
Source§impl AdaBoostClassifier<Trained>
impl AdaBoostClassifier<Trained>
Sourcepub fn estimators(&self) -> &[DecisionTreeClassifier<Trained>]
pub fn estimators(&self) -> &[DecisionTreeClassifier<Trained>]
Get the fitted base estimators
Sourcepub fn estimator_weights(&self) -> &Array1<Float>
pub fn estimator_weights(&self) -> &Array1<Float>
Get the weights for each estimator
Sourcepub fn estimator_errors(&self) -> &Array1<Float>
pub fn estimator_errors(&self) -> &Array1<Float>
Get the errors for each estimator
Sourcepub fn n_features_in(&self) -> usize
pub fn n_features_in(&self) -> usize
Get the number of input features
Sourcepub fn feature_importances(&self) -> Result<Array1<Float>>
pub fn feature_importances(&self) -> Result<Array1<Float>>
Get feature importances (averaged from all estimators)
Trait Implementations§
Source§impl<State: Clone> Clone for AdaBoostClassifier<State>
impl<State: Clone> Clone for AdaBoostClassifier<State>
Source§fn clone(&self) -> AdaBoostClassifier<State>
fn clone(&self) -> AdaBoostClassifier<State>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<State> Debug for AdaBoostClassifier<State>
impl<State> Debug for AdaBoostClassifier<State>
Source§impl Default for AdaBoostClassifier<Untrained>
impl Default for AdaBoostClassifier<Untrained>
Source§impl Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for AdaBoostClassifier<Untrained>
impl Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for AdaBoostClassifier<Untrained>
Source§type Fitted = AdaBoostClassifier<Trained>
type Fitted = AdaBoostClassifier<Trained>
The fitted model type
Source§fn fit(self, x: &Array2<Float>, y: &Array1<Float>) -> Result<Self::Fitted>
fn fit(self, x: &Array2<Float>, y: &Array1<Float>) -> Result<Self::Fitted>
Fit the model to the provided data with validation
Source§fn fit_with_validation(
self,
x: &X,
y: &Y,
_x_val: Option<&X>,
_y_val: Option<&Y>,
) -> Result<(Self::Fitted, FitMetrics), SklearsError>where
Self: Sized,
fn fit_with_validation(
self,
x: &X,
y: &Y,
_x_val: Option<&X>,
_y_val: Option<&Y>,
) -> Result<(Self::Fitted, FitMetrics), SklearsError>where
Self: Sized,
Fit with custom validation and early stopping
Source§impl Predict<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for AdaBoostClassifier<Trained>
impl Predict<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for AdaBoostClassifier<Trained>
Source§fn predict(&self, x: &Array2<Float>) -> Result<Array1<Float>>
fn predict(&self, x: &Array2<Float>) -> Result<Array1<Float>>
Make predictions on the provided data
Source§fn predict_with_uncertainty(
&self,
x: &X,
) -> Result<(Output, UncertaintyMeasure), SklearsError>
fn predict_with_uncertainty( &self, x: &X, ) -> Result<(Output, UncertaintyMeasure), SklearsError>
Make predictions with confidence intervals
Auto Trait Implementations§
impl<State> Freeze for AdaBoostClassifier<State>
impl<State> RefUnwindSafe for AdaBoostClassifier<State>where
State: RefUnwindSafe,
impl<State> Send for AdaBoostClassifier<State>where
State: Send,
impl<State> Sync for AdaBoostClassifier<State>where
State: Sync,
impl<State> Unpin for AdaBoostClassifier<State>where
State: Unpin,
impl<State> UnwindSafe for AdaBoostClassifier<State>where
State: UnwindSafe,
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> 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