pub trait Estimator<Data> {
type Model: Model<Data>;
type ModelIter: IntoIterator<Item = Self::Model>;
const MIN_SAMPLES: usize;
// Required method
fn estimate<I>(&self, data: I) -> Self::ModelIter
where I: Iterator<Item = Data> + Clone;
}
Expand description
An Estimator
is able to create a model that best fits a set of data.
It is also able to determine the residual error each data point contributes in relation to the model.
Required Associated Constants§
Sourceconst MIN_SAMPLES: usize
const MIN_SAMPLES: usize
The minimum number of samples that the estimator can estimate a model from.
Required Associated Types§
Sourcetype ModelIter: IntoIterator<Item = Self::Model>
type ModelIter: IntoIterator<Item = Self::Model>
Iterator over the models produced from the data.
Required Methods§
Sourcefn estimate<I>(&self, data: I) -> Self::ModelIter
fn estimate<I>(&self, data: I) -> Self::ModelIter
Takes in an iterator over the data and produces a model that best fits the data.
This must be passed at least Self::MIN_SAMPLES
data points, otherwise estimate
should panic
to indicate a developer error.
None
should be returned only if a model is impossible to estimate based on the data.
For instance, if a particle has greater than infinite mass, a point is detected behind a camera,
an equation has an imaginary answer, or non-causal events happen, then a model may not be produced.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.