pub trait Model {
type Features;
type Target;
// Required methods
fn num_coefficients(&self) -> usize;
fn coefficient(&mut self, coefficient: usize) -> &mut f64;
fn predict(&self, _: &Self::Features) -> Self::Target;
fn gradient(
&self,
coefficient: usize,
input: &Self::Features,
) -> Self::Target;
}Expand description
A parameterized expert algorithm
Implementations of this trait can be found in models
Required Associated Types§
Required Methods§
Sourcefn num_coefficients(&self) -> usize
fn num_coefficients(&self) -> usize
The number of internal coefficients this model depends on
Sourcefn coefficient(&mut self, coefficient: usize) -> &mut f64
fn coefficient(&mut self, coefficient: usize) -> &mut f64
Mutable reference to the n-th coefficient