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: usizeNumber of iterations to search for the optimal value
precision: usizeHow fine values you can get. 59 covers the whole range of f64
30 seems to get you ~7 significant digits
max: f64The assumed max value. Use f64::MAX to cover the whole range of f64.
randomness_factor: f64binary_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§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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.