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§
Sourcefn predict(&self, inputs: &T) -> LearningResult<U>
fn predict(&self, inputs: &T) -> LearningResult<U>
Predict output from inputs.
Implementors§
impl SupModel<Matrix<f64>, Vector<f64>> for LinRegressor
impl<'a, T, A> SupModel<Matrix<f64>, Matrix<f64>> for NeuralNet<'a, T, A>
Supervised learning for the Neural Network.
The model is trained using back propagation.
impl<A> SupModel<Matrix<f64>, Vector<f64>> for LogisticRegressor<A>where
A: OptimAlgorithm<BaseLogisticRegressor>,
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.
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.
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.