std_dev::regression

Trait PolynomialEstimator

source
pub trait PolynomialEstimator {
    // Required method
    fn model_polynomial(
        &self,
        predictors: &[f64],
        outcomes: &[f64],
        degree: usize,
    ) -> PolynomialCoefficients;

    // Provided method
    fn boxed_polynomial(self) -> Box<dyn PolynomialEstimator>
       where Self: Sized + 'static { ... }
}
Available on crate feature regression only.
Expand description

Implemented by all estimators yielding a polynomial regression.

Required Methods§

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.

§Panics

The two slices must have the same length.

Provided Methods§

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.

Implementations on Foreign Types§

source§

impl<T: PolynomialEstimator