#[non_exhaustive]pub enum ParamDistribution {
Categorical(Vec<ParamValue>),
Uniform {
low: f64,
high: f64,
},
LogUniform {
low: f64,
high: f64,
},
IntUniform {
low: usize,
high: usize,
},
}Expand description
A distribution from which hyperparameter values can be sampled.
Used with BayesSearchCV to define a continuous or discrete search space
for each hyperparameter.
§Examples
use scry_learn::search::ParamDistribution;
let lr = ParamDistribution::LogUniform { low: 0.001, high: 1.0 };
let depth = ParamDistribution::IntUniform { low: 2, high: 10 };Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Categorical(Vec<ParamValue>)
A set of discrete candidate values (any ParamValue variant).
Uniform
Continuous uniform distribution over [low, high].
LogUniform
Log-uniform distribution over [low, high] (sampled in log space).
Both low and high must be positive.
IntUniform
Discrete uniform distribution over integers [low, high].
Trait Implementations§
Source§impl Clone for ParamDistribution
impl Clone for ParamDistribution
Source§fn clone(&self) -> ParamDistribution
fn clone(&self) -> ParamDistribution
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Freeze for ParamDistribution
impl RefUnwindSafe for ParamDistribution
impl Send for ParamDistribution
impl Sync for ParamDistribution
impl Unpin for ParamDistribution
impl UnsafeUnpin for ParamDistribution
impl UnwindSafe for ParamDistribution
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