[−][src]Trait tinguely::model::SupervisedLearn
Required methods
fn predict(&self, input: &T) -> U
Predict output from inputs.
fn train(&mut self, input: &T, target: &U)
Train the model using inputs and targets.
Implementors
impl SupervisedLearn<Matrix<f64>, Vector<f64>> for SVM
[src]
fn predict(&self, input: &Matrix<f64>) -> Vector<f64>
[src]
Predict output from inputs.
fn train(&mut self, input: &Matrix<f64>, target: &Vector<f64>)
[src]
Train the model using inputs and targets.
impl<O> SupervisedLearn<Matrix<f64>, Vector<f64>> for LogisticRegression<O> where
O: OptimAlgorithm<LogisticRegressionBase>,
[src]
O: OptimAlgorithm<LogisticRegressionBase>,
fn train<'a, 'b>(&'a mut self, x: &'b Matrix<f64>, y: &'b Vector<f64>)
[src]
fn predict<'a, 'b>(&'a self, x: &'b Matrix<f64>) -> Vector<f64>
[src]
impl<O> SupervisedLearn<Matrix<f64>, Vector<f64>> for LinearRegression<O> where
O: OptimAlgorithm<LinearRegressionBase>,
[src]
O: OptimAlgorithm<LinearRegressionBase>,
fn train<'a, 'b>(&'a mut self, x: &'b Matrix<f64>, y: &'b Vector<f64>)
[src]
Train the linear regression model.
Examples
use tinguely::regression::LinearRegression; use mathru::algebra::linear::{Vector, Matrix}; use mathru::optim::StochasticGradientDesc; use tinguely::SupervisedLearn; let optimizer = StochasticGradientDesc::new(0.01, 0.0, 100); let mut lin_mod = LinearRegression::new(optimizer); let inputs = Matrix::new(3, 1, vec![2.0, 3.0, 4.0]); let targets = Vector::new_column(3, vec![5.0, 6.0, 7.0]); lin_mod.train(&inputs, &targets);