[][src]Trait vikos::Model

pub trait Model {
    type Features;
    type Target;
    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; }

A parameterized expert algorithm

Implementations of this trait can be found in models

Associated Types

type Features

Input from which to predict the target

type Target

f64 for Regressors or binary classifiers. For multi classification an array of f64 with a dimension equal to the number of classes.

Loading content...

Required methods

fn num_coefficients(&self) -> usize

The number of internal coefficients this model depends on

fn coefficient(&mut self, coefficient: usize) -> &mut f64

Mutable reference to the n-th coefficient

fn predict(&self, _: &Self::Features) -> Self::Target

Predicts a target for the inputs based on the internal coefficients

fn gradient(&self, coefficient: usize, input: &Self::Features) -> Self::Target

Value predict derived by the n-th coefficient at input

Loading content...

Implementations on Foreign Types

impl Model for f64
[src]

type Features = ()

type Target = f64

Loading content...

Implementors

impl<T> Model for OneVsRest<T> where
    T: Array,
    T::Element: Model<Target = f64>, 
[src]

type Features = <T::Element as Model>::Features

type Target = T::Vector

impl<V> Model for Linear<V> where
    V: Vector
[src]

type Features = V

type Target = f64

impl<V> Model for Logistic<V> where
    Linear<V>: Model<Features = V, Target = f64>, 
[src]

type Features = V

type Target = f64

impl<V, F, Df> Model for GeneralizedLinearModel<V, F, Df> where
    F: Fn(f64) -> f64,
    Df: Fn(f64) -> f64,
    Linear<V>: Model<Features = V, Target = f64>, 
[src]

type Features = V

type Target = f64

Loading content...