SupModel

Trait SupModel 

Source
pub trait SupModel<T, U> {
    // Required methods
    fn predict(&self, inputs: &T) -> LearningResult<U>;
    fn train(&mut self, inputs: &T, targets: &U) -> LearningResult<()>;
}
Expand description

Trait for supervised model.

Required Methods§

Source

fn predict(&self, inputs: &T) -> LearningResult<U>

Predict output from inputs.

Source

fn train(&mut self, inputs: &T, targets: &U) -> LearningResult<()>

Train the model using inputs and targets.

Implementors§

Source§

impl SupModel<Matrix<f64>, Vector<f64>> for LinRegressor

Source§

impl<'a, T, A> SupModel<Matrix<f64>, Matrix<f64>> for NeuralNet<'a, T, A>
where T: Criterion, A: OptimAlgorithm<BaseNeuralNet<'a, T>>,

Supervised learning for the Neural Network.

The model is trained using back propagation.

Source§

impl<A> SupModel<Matrix<f64>, Vector<f64>> for LogisticRegressor<A>

Source§

impl<C: Criterion> SupModel<Matrix<f64>, Vector<f64>> for GenLinearModel<C>

Supervised model trait for the GLM.

Predictions are made from the model by computing g^-1(Xb).

The model is trained using Iteratively Re-weighted Least Squares.

Source§

impl<K: Kernel> SupModel<Matrix<f64>, Vector<f64>> for SVM<K>

Train the model using the Pegasos algorithm and predict the model output from new data.

Source§

impl<T: Distribution> SupModel<Matrix<f64>, Matrix<f64>> for NaiveBayes<T>

Train and predict from the Naive Bayes model.

The input matrix must be rows made up of features. The target matrix should have indicator vectors in each row specifying the input class. e.g. [[1,0,0],[0,0,1]] shows class 1 first, then class 3.

Source§

impl<T: Kernel, U: MeanFunc> SupModel<Matrix<f64>, Vector<f64>> for GaussianProcess<T, U>