pub trait LinearEstimator {
// Required method
fn model_linear(
&self,
predictors: &[f64],
outcomes: &[f64],
) -> LinearCoefficients;
// Provided method
fn boxed_linear(self) -> Box<dyn LinearEstimator>
where Self: Sized + 'static { ... }
}
Available on crate feature
regression
only.Expand description
Implemented by all estimators yielding a linear 2 variable regression (a line).
Required Methods§
sourcefn model_linear(
&self,
predictors: &[f64],
outcomes: &[f64],
) -> LinearCoefficients
fn model_linear( &self, predictors: &[f64], outcomes: &[f64], ) -> LinearCoefficients
Model the LinearCoefficients
from predictors
and outcomes
.
§Panics
The two slices must have the same length.
Provided Methods§
sourcefn boxed_linear(self) -> Box<dyn LinearEstimator>where
Self: Sized + 'static,
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.