Shrinkage

shrinkage::DifferentiableDatafit

Shrinkage for Rust · rust · 0.3.0

pub trait DifferentiableDatafit: Datafit<Error = shrinkage::FitError>

A differentiable loss on the complete linear predictor.

Proximal gradient uses this derivative with forward and transposed design products. Implementations must use the same normalization in both methods.

Methods

fits_intercept

fn fits_intercept(&self) -> bool

Whether the solver should fit a free, unpenalized intercept.

gradient

fn gradient(
    &self,
    predictor: &[f64],
    output: &mut [f64]
) -> Result<(), FitError>

Write the predictor gradient into reusable output storage.

Errors

Reject invalid response data, dimensions, predictor values, or arithmetic. Output is unspecified after an error.

n_obs

fn n_obs(&self) -> usize

Number of training observations.

Implementation of DifferentiableDatafit

impl DifferentiableDatafit for Binomial<'_>

Implementation of DifferentiableDatafit

impl DifferentiableDatafit for Gaussian<'_>

Implementation of DifferentiableDatafit

impl<L: Link> DifferentiableDatafit for LinkedDatafit<shrinkage::Binomial<'_>, L>

Implementation of DifferentiableDatafit

impl<L: Link> DifferentiableDatafit for LinkedDatafit<shrinkage::Gaussian<'_>, L>