pub struct BanditOptimization<E, S> { /* private fields */ }Expand description
Bandit-based hyperparameter optimization with cross-validation
Implementations§
Source§impl<E, S> BanditOptimization<E, S>where
E: Clone + Fit<ArrayBase<OwnedRepr<Float>, Dim<[usize; 2]>, Float>, ArrayBase<OwnedRepr<Float>, Dim<[usize; 1]>, Float>> + Predict<ArrayBase<OwnedRepr<Float>, Dim<[usize; 2]>, Float>, ArrayBase<OwnedRepr<Float>, Dim<[usize; 1]>, Float>>,
S: Fn(&E::Fitted, &ArrayBase<OwnedRepr<Float>, Dim<[usize; 2]>, Float>, &ArrayBase<OwnedRepr<Float>, Dim<[usize; 1]>, Float>) -> Result<f64>,
impl<E, S> BanditOptimization<E, S>where
E: Clone + Fit<ArrayBase<OwnedRepr<Float>, Dim<[usize; 2]>, Float>, ArrayBase<OwnedRepr<Float>, Dim<[usize; 1]>, Float>> + Predict<ArrayBase<OwnedRepr<Float>, Dim<[usize; 2]>, Float>, ArrayBase<OwnedRepr<Float>, Dim<[usize; 1]>, Float>>,
S: Fn(&E::Fitted, &ArrayBase<OwnedRepr<Float>, Dim<[usize; 2]>, Float>, &ArrayBase<OwnedRepr<Float>, Dim<[usize; 1]>, Float>) -> Result<f64>,
Sourcepub fn new(
estimator: E,
parameter_space: Vec<ParameterValue>,
scorer: Box<S>,
cv_folds: usize,
) -> Self
pub fn new( estimator: E, parameter_space: Vec<ParameterValue>, scorer: Box<S>, cv_folds: usize, ) -> Self
Create a new bandit optimization
Sourcepub fn set_n_iter(&mut self, n_iter: usize)
pub fn set_n_iter(&mut self, n_iter: usize)
Set number of iterations
Sourcepub fn set_strategy(&mut self, strategy: BanditStrategy)
pub fn set_strategy(&mut self, strategy: BanditStrategy)
Set bandit strategy
Sourcepub fn set_random_state(&mut self, seed: u64)
pub fn set_random_state(&mut self, seed: u64)
Set random state for reproducibility
Trait Implementations§
Source§impl<E: Clone, S: Clone> Clone for BanditOptimization<E, S>
impl<E: Clone, S: Clone> Clone for BanditOptimization<E, S>
Source§fn clone(&self) -> BanditOptimization<E, S>
fn clone(&self) -> BanditOptimization<E, S>
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 moreAuto Trait Implementations§
impl<E, S> Freeze for BanditOptimization<E, S>where
E: Freeze,
impl<E, S> RefUnwindSafe for BanditOptimization<E, S>where
E: RefUnwindSafe,
S: RefUnwindSafe,
impl<E, S> Send for BanditOptimization<E, S>
impl<E, S> Sync for BanditOptimization<E, S>
impl<E, S> Unpin for BanditOptimization<E, S>where
E: Unpin,
impl<E, S> UnsafeUnpin for BanditOptimization<E, S>where
E: UnsafeUnpin,
impl<E, S> UnwindSafe for BanditOptimization<E, S>where
E: UnwindSafe,
S: 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