Trait vikos::Model
[−]
[src]
pub trait Model: Clone { type Input; fn predict(&self, &Self::Input) -> f64; fn num_coefficents(&self) -> usize; fn gradient(&self, coefficent: usize, input: &Self::Input) -> f64; fn coefficent(&mut self, coefficent: usize) -> &mut f64; }
A Model is a parameterized expert algorithm
Implementations of this trait can be found in models
Associated Types
type Input
Input features
Required Methods
fn predict(&self, &Self::Input) -> f64
Predicts a target for the inputs based on the internal coefficents
fn num_coefficents(&self) -> usize
The number of internal coefficents this model depends on
fn gradient(&self, coefficent: usize, input: &Self::Input) -> f64
Value predict derived by the n-th coefficent
at input
fn coefficent(&mut self, coefficent: usize) -> &mut f64
Mutable reference to the n-th coefficent