Trait potpourri::Learning

source ·
pub trait Learning {
    type DataIn<'a>;
    type DataOut;

    // Required methods
    fn fit(&mut self, data: &Self::DataIn<'_>) -> Result<(), Error>;
    fn predict(&self, data: &Self::DataIn<'_>) -> Result<Self::DataOut, Error>;
}
Expand description

Probabilistic mixables should implement this trait A mixture model has a discrete and unobservable variable (i.e., latent) variable associated with each data point. It can be interpreted as a pointer to the component of a mixture generated the sample. This component computes weights the components in the mixture, that is, the probability for each component that the next sample will be drawn from it. In case of non-probabilistic models (k-mm and SOM) this is irrelevant.

Required Associated Types§

Required Methods§

source

fn fit(&mut self, data: &Self::DataIn<'_>) -> Result<(), Error>

source

fn predict(&self, data: &Self::DataIn<'_>) -> Result<Self::DataOut, Error>

Implementors§

source§

impl<T> Learning for Model<T>where T: Parametrizable + Sync + Clone + Send,

§

type DataIn<'a> = <T as Parametrizable>::DataIn<'a>

§

type DataOut = <T as Parametrizable>::DataOut