pub struct TPEOptimizer { /* private fields */ }Expand description
Tree-structured Parzen Estimator (TPE) for hyperparameter optimization
Implementations§
Source§impl TPEOptimizer
impl TPEOptimizer
Sourcepub fn new(param_distributions: HashMap<String, ParamDistribution>) -> Self
pub fn new(param_distributions: HashMap<String, ParamDistribution>) -> Self
Create a new TPE optimizer
Sourcepub fn n_initial_points(self, n_initial_points: usize) -> Self
pub fn n_initial_points(self, n_initial_points: usize) -> Self
Set the number of initial random samples
Sourcepub fn gamma(self, gamma: Float) -> Self
pub fn gamma(self, gamma: Float) -> Self
Set the gamma parameter (quantile for good/bad observations)
Sourcepub fn random_state(self, random_state: u64) -> Self
pub fn random_state(self, random_state: u64) -> Self
Set the random state
Sourcepub fn optimize<E, CV, F>(
&mut self,
estimator: E,
x: &Array2<Float>,
y: &Array1<i32>,
cv: CV,
scoring: F,
) -> Result<()>
pub fn optimize<E, CV, F>( &mut self, estimator: E, x: &Array2<Float>, y: &Array1<i32>, cv: CV, scoring: F, ) -> Result<()>
Perform TPE hyperparameter search
Sourcepub fn best_score(&self) -> Option<Float>
pub fn best_score(&self) -> Option<Float>
Get the best score found
Sourcepub fn evaluations(&self) -> &[EvaluationPoint]
pub fn evaluations(&self) -> &[EvaluationPoint]
Get all evaluations
Auto Trait Implementations§
impl Freeze for TPEOptimizer
impl RefUnwindSafe for TPEOptimizer
impl Send for TPEOptimizer
impl Sync for TPEOptimizer
impl Unpin for TPEOptimizer
impl UnwindSafe for TPEOptimizer
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