Trait vikos::Model
[−]
[src]
pub trait Model: Clone { type Input; type Target: Float; fn predict(&self, &Self::Input) -> Self::Target; fn num_coefficents(&self) -> usize; fn gradient(&self, coefficent: usize, input: &Self::Input) -> Self::Target; fn coefficent(&mut self, coefficent: usize) -> &mut Self::Target; }
A Model is defines how to predict a target from an input
A model usually depends on several coefficents whose values are derived using a training algorithm
Associated Types
Required Methods
fn predict(&self, &Self::Input) -> Self::Target
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) -> Self::Target
Value predict derived by the n-th coefficent
at input
fn coefficent(&mut self, coefficent: usize) -> &mut Self::Target
Mutable reference to the n-th coefficent