pub struct LogisticRegressor<A>where
    A: OptimAlgorithm<BaseLogisticRegressor>,
{ /* private fields */ }
Expand description

Logistic Regression Model.

Contains option for optimized parameter.

Implementations

Constructs untrained logistic regression model.

Examples
use rusty_machine::learning::logistic_reg::LogisticRegressor;
use rusty_machine::learning::optim::grad_desc::GradientDesc;

let gd = GradientDesc::default();
let mut logistic_mod = LogisticRegressor::new(gd);

Get the parameters from the model.

Returns an option that is None if the model has not been trained.

Set the parameters in the model.

Trait Implementations

Formats the value using the given formatter. Read more

Constructs a default Logistic Regression model using standard gradient descent.

Returns the “default value” for a type. Read more

Train the logistic regression model.

Takes training data and output values as input.

Examples
use rusty_machine::learning::logistic_reg::LogisticRegressor;
use rusty_machine::linalg::Matrix;
use rusty_machine::linalg::Vector;
use rusty_machine::learning::SupModel;

let mut logistic_mod = LogisticRegressor::default();
let inputs = Matrix::new(3,2, vec![1.0, 2.0, 1.0, 3.0, 1.0, 4.0]);
let targets = Vector::new(vec![5.0, 6.0, 7.0]);

logistic_mod.train(&inputs, &targets).unwrap();

Predict output value from input data.

Model must be trained before prediction can be made.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.