pub struct Options {
    pub iterations: usize,
    pub precision: usize,
    pub max: f64,
    pub randomness_factor: f64,
    pub random_subset_regression: Option<Config>,
}
Available on crate feature 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
Available on crate feature 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>
Available on crate feature random_subset_regression only.

Config for using random_subset_regression.

Implementations§

source§

impl Options

source

pub fn max_precision(&self) -> Self

Get max precision of every variable.

source

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.

source

pub 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.

Optimize n variables to fitness_function. Will return a set of values which (hopefully) minimize fitness_function.

Trait Implementations§

source§

impl Clone for Options

source§

fn clone(&self) -> Options

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl CosecantEstimator for Options

source§

fn model_cosecant( &self, predictors: &[f64], outcomes: &[f64], max_frequency: f64 ) -> CosecantCoefficients

Model the CosecantCoefficients from predictors and outcomes. Read more
source§

fn boxed_cosecant(self) -> Box<dyn CosecantEstimator>where Self: Sized + 'static,

Put this estimator in a box. This is useful for conditionally choosing different estimators.
source§

impl CosineEstimator for Options

source§

fn model_cosine( &self, predictors: &[f64], outcomes: &[f64], max_frequency: f64 ) -> CosineCoefficients

Model the CosineCoefficients from predictors and outcomes. Read more
source§

fn boxed_cosine(self) -> Box<dyn CosineEstimator>where Self: Sized + 'static,

Put this estimator in a box. This is useful for conditionally choosing different estimators.
source§

impl CotangentEstimator for Options

source§

fn model_cotangent( &self, predictors: &[f64], outcomes: &[f64], max_frequency: f64 ) -> CotangentCoefficients

Model the CotangentCoefficients from predictors and outcomes. Read more
source§

fn boxed_cotangent(self) -> Box<dyn CotangentEstimator>where Self: Sized + 'static,

Put this estimator in a box. This is useful for conditionally choosing different estimators.
source§

impl Debug for Options

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Options

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl ExponentialEstimator for Options

source§

fn model_exponential( &self, predictors: &[f64], outcomes: &[f64] ) -> ExponentialCoefficients

Model the ExponentialCoefficients from predictors and outcomes. Read more
source§

fn boxed_exponential(self) -> Box<dyn ExponentialEstimator>where Self: Sized + 'static,

Put this estimator in a box. This is useful for conditionally choosing different estimators.
source§

impl LinearEstimator for Options

source§

fn model_linear( &self, predictors: &[f64], outcomes: &[f64] ) -> LinearCoefficients

Model the LinearCoefficients from predictors and outcomes. Read more
source§

fn boxed_linear(self) -> Box<dyn LinearEstimator>where Self: Sized + 'static,

Put this estimator in a box. This is useful for conditionally choosing different estimators.
source§

impl LogisticEstimator for Options

source§

fn model_logistic( &self, predictors: &[f64], outcomes: &[f64] ) -> LogisticCoefficients

Model the LogisticCoefficients from predictors and outcomes. Read more
source§

fn boxed_logistic(self) -> Box<dyn LogisticEstimator>where Self: Sized + 'static,

Put this estimator in a box. This is useful for conditionally choosing different estimators.
source§

impl PartialEq<Options> for Options

source§

fn eq(&self, other: &Options) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PolynomialEstimator for Options

Available on crate feature binary_search_rng only.
source§

fn model_polynomial( &self, predictors: &[f64], outcomes: &[f64], degree: usize ) -> PolynomialCoefficients

Model the 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 more
source§

fn boxed_polynomial(self) -> Box<dyn PolynomialEstimator>where Self: Sized + 'static,

Put this estimator in a box. This is useful for conditionally choosing different estimators.
source§

impl PowerEstimator for Options

source§

fn model_power(&self, predictors: &[f64], outcomes: &[f64]) -> PowerCoefficients

Model the PowerCoefficients from predictors and outcomes. Read more
source§

fn boxed_power(self) -> Box<dyn PowerEstimator>where Self: Sized + 'static,

Put this estimator in a box. This is useful for conditionally choosing different estimators.
source§

impl SecantEstimator for Options

source§

fn model_secant( &self, predictors: &[f64], outcomes: &[f64], max_frequency: f64 ) -> SecantCoefficients

Model the SecantCoefficients from predictors and outcomes. Read more
source§

fn boxed_sesecant(self) -> Box<dyn SecantEstimator>where Self: Sized + 'static,

Put this estimator in a box. This is useful for conditionally choosing different estimators.
source§

impl SineEstimator for Options

source§

fn model_sine( &self, predictors: &[f64], outcomes: &[f64], max_frequency: f64 ) -> SineCoefficients

Model the SineCoefficients from predictors and outcomes. Read more
source§

fn boxed_sine(self) -> Box<dyn SineEstimator>where Self: Sized + 'static,

Put this estimator in a box. This is useful for conditionally choosing different estimators.
source§

impl TangentEstimator for Options

source§

fn model_tangent( &self, predictors: &[f64], outcomes: &[f64], max_frequency: f64 ) -> TangentCoefficients

Model the TangentCoefficients from predictors and outcomes. Read more
source§

fn boxed_tangent(self) -> Box<dyn TangentEstimator>where Self: Sized + 'static,

Put this estimator in a box. This is useful for conditionally choosing different estimators.
source§

impl Copy for Options

source§

impl StructuralPartialEq for Options

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dstwhere T: Cast<Dst>,

Casts the value.
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dstwhere Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

OverflowingCasts the value.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dstwhere T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dstwhere T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

UnwrappedCasts the value.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dstwhere T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

WrappingCasts the value.
source§

impl<T> Scalar for Twhere T: 'static + Clone + PartialEq<T> + Debug,