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§
sourcefn model_polynomial(
&self,
predictors: &[f64],
outcomes: &[f64],
degree: usize,
) -> PolynomialCoefficients
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§
sourcefn boxed_polynomial(self) -> Box<dyn PolynomialEstimator>where
Self: Sized + 'static,
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.