Struct rusty_machine::learning::glm::GenLinearModel [] [src]

pub struct GenLinearModel<C: Criterion> {
    // some fields omitted
}

The Generalized Linear Model

The model is generic over a Criterion which specifies the distribution family and the link function.

Methods

impl<C: Criterion> GenLinearModel<C>
[src]

fn new(criterion: C) -> GenLinearModel<C>

Constructs a new Generalized Linear Model.

Takes a Criterion which fully specifies the family and the link function used by the GLM.

use rusty_machine::learning::glm::GenLinearModel;
use rusty_machine::learning::glm::Bernoulli;

let glm = GenLinearModel::new(Bernoulli);

Trait Implementations

impl<C: Debug + Criterion> Debug for GenLinearModel<C>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

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

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.

fn predict(&self, inputs: &Matrix<f64>) -> Vector<f64>

Predict output from inputs.

fn train(&mut self, inputs: &Matrix<f64>, targets: &Vector<f64>)

Train the model using inputs and targets.