Trait rusty_machine::learning::SupModel
source · [−]pub trait SupModel<T, U> {
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.
sourcefn train(&mut self, inputs: &T, targets: &U) -> LearningResult<()>
fn train(&mut self, inputs: &T, targets: &U) -> LearningResult<()>
Train the model using inputs and targets.
Implementors
impl SupModel<Matrix<f64>, Vector<f64>> for LinRegressor
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<S: KNearestSearch> SupModel<Matrix<f64>, Vector<usize>> for KNNClassifier<S>
impl<T, A> SupModel<Matrix<f64>, Matrix<f64>> for NeuralNet<T, A>where
T: Criterion,
A: OptimAlgorithm<BaseNeuralNet<T>>,
Supervised learning for the Neural Network.
The model is trained using back propagation.
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.