pub struct Options {
pub iterations: usize,
pub precision: usize,
pub max: f64,
pub randomness_factor: f64,
pub random_subset_regression: Option<Config>,
}
regression
only.Expand description
Options for the binary search optimization.
Fields§
§iterations: usize
Number of iterations to search for the optimal value
precision: usize
How fine values you can get. 59 covers the whole range of f64
30 seems to get you ~7 significant digits
max: f64
The assumed max value. Use f64::MAX
to cover the whole range of f64
.
randomness_factor: f64
binary_search_rng
only.The factor for the randomness introduced when binary searching. Higher values result in finding more optimal values, but can also make it hard for the algorithm to find a good value.
random_subset_regression: Option<Config>
random_subset_regression
only.Config for using random_subset_regression
.
Implementations§
source§impl Options
impl Options
sourcepub fn max_precision(&self) -> Self
pub fn max_precision(&self) -> Self
Get max precision of every variable.
sourcepub fn n_variable_optimization_no_rng<NV: NVariableStorage>(
&self,
fitness_function: impl Fn(NV::Given<'_>) -> f64,
data: NV::Data,
) -> NV
pub fn n_variable_optimization_no_rng<NV: NVariableStorage>( &self, fitness_function: impl Fn(NV::Given<'_>) -> f64, data: NV::Data, ) -> NV
Like Options::n_variable_optimization
but without random variation. More easily
falls into local maxima (a variables thought to be the best). Useful for independent
variables.
Faster than Options::n_variable_optimization
.
sourcepub fn n_variable_optimization<NV: NVariableStorage>(
&self,
fitness_function: impl Fn(NV::Given<'_>) -> f64,
data: NV::Data,
rng: &mut impl Rng,
) -> NV
Available on crate feature binary_search_rng
only.
pub fn n_variable_optimization<NV: NVariableStorage>( &self, fitness_function: impl Fn(NV::Given<'_>) -> f64, data: NV::Data, rng: &mut impl Rng, ) -> NV
binary_search_rng
only.Optimize n
variables to fitness_function
.
Will return a set of values which (hopefully) minimize fitness_function
.
Trait Implementations§
source§impl CosecantEstimator for Options
impl CosecantEstimator for Options
source§fn model_cosecant(
&self,
predictors: &[f64],
outcomes: &[f64],
max_frequency: f64,
) -> CosecantCoefficients
fn model_cosecant( &self, predictors: &[f64], outcomes: &[f64], max_frequency: f64, ) -> CosecantCoefficients
source§fn boxed_cosecant(self) -> Box<dyn CosecantEstimator>where
Self: Sized + 'static,
fn boxed_cosecant(self) -> Box<dyn CosecantEstimator>where
Self: Sized + 'static,
source§impl CosineEstimator for Options
impl CosineEstimator for Options
source§fn model_cosine(
&self,
predictors: &[f64],
outcomes: &[f64],
max_frequency: f64,
) -> CosineCoefficients
fn model_cosine( &self, predictors: &[f64], outcomes: &[f64], max_frequency: f64, ) -> CosineCoefficients
source§fn boxed_cosine(self) -> Box<dyn CosineEstimator>where
Self: Sized + 'static,
fn boxed_cosine(self) -> Box<dyn CosineEstimator>where
Self: Sized + 'static,
source§impl CotangentEstimator for Options
impl CotangentEstimator for Options
source§fn model_cotangent(
&self,
predictors: &[f64],
outcomes: &[f64],
max_frequency: f64,
) -> CotangentCoefficients
fn model_cotangent( &self, predictors: &[f64], outcomes: &[f64], max_frequency: f64, ) -> CotangentCoefficients
source§fn boxed_cotangent(self) -> Box<dyn CotangentEstimator>where
Self: Sized + 'static,
fn boxed_cotangent(self) -> Box<dyn CotangentEstimator>where
Self: Sized + 'static,
source§impl ExponentialEstimator for Options
impl ExponentialEstimator for Options
source§fn model_exponential(
&self,
predictors: &[f64],
outcomes: &[f64],
) -> ExponentialCoefficients
fn model_exponential( &self, predictors: &[f64], outcomes: &[f64], ) -> ExponentialCoefficients
source§fn boxed_exponential(self) -> Box<dyn ExponentialEstimator>where
Self: Sized + 'static,
fn boxed_exponential(self) -> Box<dyn ExponentialEstimator>where
Self: Sized + 'static,
source§impl LinearEstimator for Options
impl LinearEstimator for Options
source§fn model_linear(
&self,
predictors: &[f64],
outcomes: &[f64],
) -> LinearCoefficients
fn model_linear( &self, predictors: &[f64], outcomes: &[f64], ) -> LinearCoefficients
source§fn boxed_linear(self) -> Box<dyn LinearEstimator>where
Self: Sized + 'static,
fn boxed_linear(self) -> Box<dyn LinearEstimator>where
Self: Sized + 'static,
source§impl LogisticEstimator for Options
impl LogisticEstimator for Options
source§fn model_logistic(
&self,
predictors: &[f64],
outcomes: &[f64],
) -> LogisticCoefficients
fn model_logistic( &self, predictors: &[f64], outcomes: &[f64], ) -> LogisticCoefficients
source§fn boxed_logistic(self) -> Box<dyn LogisticEstimator>where
Self: Sized + 'static,
fn boxed_logistic(self) -> Box<dyn LogisticEstimator>where
Self: Sized + 'static,
source§impl PolynomialEstimator for Options
Available on crate feature binary_search_rng
only.
impl PolynomialEstimator for Options
binary_search_rng
only.source§fn model_polynomial(
&self,
predictors: &[f64],
outcomes: &[f64],
degree: usize,
) -> PolynomialCoefficients
fn model_polynomial( &self, predictors: &[f64], outcomes: &[f64], degree: usize, ) -> PolynomialCoefficients
PolynomialCoefficients
from predictors
and outcomes
.
Also takes a degree
of the target polynomial. Some estimators may panic when degree
is out of their range. Read moresource§fn boxed_polynomial(self) -> Box<dyn PolynomialEstimator>where
Self: Sized + 'static,
fn boxed_polynomial(self) -> Box<dyn PolynomialEstimator>where
Self: Sized + 'static,
source§impl PowerEstimator for Options
impl PowerEstimator for Options
source§fn model_power(&self, predictors: &[f64], outcomes: &[f64]) -> PowerCoefficients
fn model_power(&self, predictors: &[f64], outcomes: &[f64]) -> PowerCoefficients
source§fn boxed_power(self) -> Box<dyn PowerEstimator>where
Self: Sized + 'static,
fn boxed_power(self) -> Box<dyn PowerEstimator>where
Self: Sized + 'static,
source§impl SecantEstimator for Options
impl SecantEstimator for Options
source§fn model_secant(
&self,
predictors: &[f64],
outcomes: &[f64],
max_frequency: f64,
) -> SecantCoefficients
fn model_secant( &self, predictors: &[f64], outcomes: &[f64], max_frequency: f64, ) -> SecantCoefficients
source§fn boxed_sesecant(self) -> Box<dyn SecantEstimator>where
Self: Sized + 'static,
fn boxed_sesecant(self) -> Box<dyn SecantEstimator>where
Self: Sized + 'static,
source§impl SineEstimator for Options
impl SineEstimator for Options
source§fn model_sine(
&self,
predictors: &[f64],
outcomes: &[f64],
max_frequency: f64,
) -> SineCoefficients
fn model_sine( &self, predictors: &[f64], outcomes: &[f64], max_frequency: f64, ) -> SineCoefficients
source§fn boxed_sine(self) -> Box<dyn SineEstimator>where
Self: Sized + 'static,
fn boxed_sine(self) -> Box<dyn SineEstimator>where
Self: Sized + 'static,
source§impl TangentEstimator for Options
impl TangentEstimator for Options
source§fn model_tangent(
&self,
predictors: &[f64],
outcomes: &[f64],
max_frequency: f64,
) -> TangentCoefficients
fn model_tangent( &self, predictors: &[f64], outcomes: &[f64], max_frequency: f64, ) -> TangentCoefficients
source§fn boxed_tangent(self) -> Box<dyn TangentEstimator>where
Self: Sized + 'static,
fn boxed_tangent(self) -> Box<dyn TangentEstimator>where
Self: Sized + 'static,
impl Copy for Options
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.