Struct compute::predict::GLM[][src]

pub struct GLM {
    pub family: ExponentialFamily,
    pub alpha: f64,
    pub tolerance: f64,
    pub weights: Option<Vec<f64>>,
    // some fields omitted
}
Expand description

Fields

family: ExponentialFamilyalpha: f64tolerance: f64weights: Option<Vec<f64>>

Implementations

Create a new general linear model with the given exponential family. alpha sets the L2 (ridge regression) regularization strength, and tolerance sets the convergence tolerance.

Set the L2 (ridge regression) regularization strength.

Set the convergence tolerance.

Set the model coefficients.

Set the sample weights (usually measurement errors).

Set the offsets (usually used in Poisson regression models).

Fit the GLM using the scoring algorithm, which gives the maximumum likelihood estimate. It performs a maximum of max_iter iterations. Note that x must be a design matrix (i.e., the first column must contain all 1’s).

Return the maximum likelihood estimates for the parameters.

Return the deviance of the model.

Calculates the Akaike information criterion for the model.

Calculates the Bayesian information criterion for the model.

Calculates the dispersion of the model.

Returns the fitted covariance for the estimated parameters.

Returns the estimated standard errors on the estimated parameters. This is equivalent to the square root of the diagonals of the covariance matrix.

Use the fitted model to make predictions on some new data.

Make some new predictions and calculate the score of those predictions based on known responses.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.