pub struct ModelSelector<T: FloatBounds + ScalarOperand + ToPrimitive + Sum> { /* private fields */ }Expand description
Model selection and comparison framework
Implementations§
Source§impl<T: FloatBounds + ScalarOperand + ToPrimitive + Sum> ModelSelector<T>
impl<T: FloatBounds + ScalarOperand + ToPrimitive + Sum> ModelSelector<T>
Sourcepub fn new(cv_config: CrossValidationConfig) -> Self
pub fn new(cv_config: CrossValidationConfig) -> Self
Create a new model selector
Sourcepub fn cross_validate_classifier(
&self,
X: &Array2<T>,
y: &[usize],
hidden_layer_sizes: &[usize],
activation: Activation,
learning_rate: T,
alpha: T,
max_iter: usize,
) -> Result<CrossValidationResults<T>, SklearsError>
pub fn cross_validate_classifier( &self, X: &Array2<T>, y: &[usize], hidden_layer_sizes: &[usize], activation: Activation, learning_rate: T, alpha: T, max_iter: usize, ) -> Result<CrossValidationResults<T>, SklearsError>
Perform k-fold cross-validation on a classifier
Sourcepub fn cross_validate_regressor(
&self,
X: &Array2<T>,
y: &Array1<T>,
hidden_layer_sizes: &[usize],
activation: Activation,
learning_rate: T,
alpha: T,
max_iter: usize,
) -> Result<CrossValidationResults<T>, SklearsError>
pub fn cross_validate_regressor( &self, X: &Array2<T>, y: &Array1<T>, hidden_layer_sizes: &[usize], activation: Activation, learning_rate: T, alpha: T, max_iter: usize, ) -> Result<CrossValidationResults<T>, SklearsError>
Perform k-fold cross-validation on a regressor
Sourcepub fn grid_search_classifier(
&self,
X: &Array2<T>,
y: &[usize],
config: GridSearchConfig<T>,
) -> Result<GridSearchResults<T>, SklearsError>
pub fn grid_search_classifier( &self, X: &Array2<T>, y: &[usize], config: GridSearchConfig<T>, ) -> Result<GridSearchResults<T>, SklearsError>
Perform grid search for classifier
Sourcepub fn compare_models(
&mut self,
models: Vec<ModelMetrics<T>>,
) -> Vec<ModelMetrics<T>>
pub fn compare_models( &mut self, models: Vec<ModelMetrics<T>>, ) -> Vec<ModelMetrics<T>>
Compare multiple models
Sourcepub fn get_rankings(&self) -> Vec<(usize, &ModelMetrics<T>)>
pub fn get_rankings(&self) -> Vec<(usize, &ModelMetrics<T>)>
Get model rankings
Trait Implementations§
Source§impl<T: Debug + FloatBounds + ScalarOperand + ToPrimitive + Sum> Debug for ModelSelector<T>
impl<T: Debug + FloatBounds + ScalarOperand + ToPrimitive + Sum> Debug for ModelSelector<T>
Auto Trait Implementations§
impl<T> Freeze for ModelSelector<T>
impl<T> RefUnwindSafe for ModelSelector<T>where
T: RefUnwindSafe,
impl<T> Send for ModelSelector<T>
impl<T> Sync for ModelSelector<T>
impl<T> Unpin for ModelSelector<T>where
T: Unpin,
impl<T> UnsafeUnpin for ModelSelector<T>
impl<T> UnwindSafe for ModelSelector<T>where
T: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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