pub struct BanditSearchCV<E> { /* private fields */ }Expand description
Bandit-based cross-validation optimizer
Implementations§
Source§impl<E> BanditSearchCV<E>where
E: Clone,
impl<E> BanditSearchCV<E>where
E: Clone,
Sourcepub fn new(estimator: E, param_space: Vec<ParameterValue>) -> Self
pub fn new(estimator: E, param_space: Vec<ParameterValue>) -> Self
Create a new bandit search CV
Sourcepub fn with_strategy(self, strategy: BanditStrategy) -> Self
pub fn with_strategy(self, strategy: BanditStrategy) -> Self
Set the bandit strategy
Sourcepub fn with_config(self, config: BanditConfig) -> Self
pub fn with_config(self, config: BanditConfig) -> Self
Set the configuration
Sourcepub fn with_scoring(self, scoring: Scoring) -> Self
pub fn with_scoring(self, scoring: Scoring) -> Self
Set the scoring method
Sourcepub fn with_param_config<F>(self, func: F) -> Self
pub fn with_param_config<F>(self, func: F) -> Self
Set the parameter configuration function
Sourcepub fn fit<F, C>(
&self,
x: &Array2<Float>,
y: &Array1<Float>,
cv: &C,
) -> Result<BanditOptimizationResult>where
F: Clone + Predict<ArrayBase<OwnedRepr<Float>, Dim<[usize; 2]>, Float>, ArrayBase<OwnedRepr<Float>, Dim<[usize; 1]>, Float>> + Score<ArrayBase<OwnedRepr<Float>, Dim<[usize; 2]>, Float>, ArrayBase<OwnedRepr<Float>, Dim<[usize; 1]>, Float>, Float = f64>,
E: Fit<ArrayBase<OwnedRepr<Float>, Dim<[usize; 2]>, Float>, ArrayBase<OwnedRepr<Float>, Dim<[usize; 1]>, Float>, Fitted = F>,
C: CrossValidator,
pub fn fit<F, C>(
&self,
x: &Array2<Float>,
y: &Array1<Float>,
cv: &C,
) -> Result<BanditOptimizationResult>where
F: Clone + Predict<ArrayBase<OwnedRepr<Float>, Dim<[usize; 2]>, Float>, ArrayBase<OwnedRepr<Float>, Dim<[usize; 1]>, Float>> + Score<ArrayBase<OwnedRepr<Float>, Dim<[usize; 2]>, Float>, ArrayBase<OwnedRepr<Float>, Dim<[usize; 1]>, Float>, Float = f64>,
E: Fit<ArrayBase<OwnedRepr<Float>, Dim<[usize; 2]>, Float>, ArrayBase<OwnedRepr<Float>, Dim<[usize; 1]>, Float>, Fitted = F>,
C: CrossValidator,
Fit the bandit search optimizer
Auto Trait Implementations§
impl<E> Freeze for BanditSearchCV<E>where
E: Freeze,
impl<E> !RefUnwindSafe for BanditSearchCV<E>
impl<E> !Send for BanditSearchCV<E>
impl<E> !Sync for BanditSearchCV<E>
impl<E> Unpin for BanditSearchCV<E>where
E: Unpin,
impl<E> UnsafeUnpin for BanditSearchCV<E>where
E: UnsafeUnpin,
impl<E> !UnwindSafe for BanditSearchCV<E>
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