Shrinkage

shrinkage::IrlsFit

Shrinkage for Rust · rust · 0.3.0

pub struct IrlsFit

Original-scale parameters and full-loss KKT diagnostics from crate::Irls.

Predictions are linear predictors, including logits for default binomial models. Objectives and KKT violations use optimization-scale coefficients. A finite KKT tolerance certifies approximate stationarity, not existence of a finite exact optimum for a separated or constant-boundary binomial model.

Inherent implementation

impl IrlsFit

coefficients

pub fn coefficients(&self) -> &[f64]

Original-scale coefficients in training-column order.

coordinate_sweeps

pub fn coordinate_sweeps(&self) -> usize

Total coordinate sweeps across all quadratic models for this fit.

intercept

pub fn intercept(&self) -> f64

Original-scale intercept, including the correction for centering.

iterations

pub fn iterations(&self) -> usize

Number of accepted outer IRLS steps.

kkt_violation

pub fn kkt_violation(&self) -> f64

Maximum full-loss KKT violation, including the unpenalized intercept.

objective

pub fn objective(&self) -> f64

Final primal objective P(beta_0, beta) = F(beta_0, beta) + R(beta).

predict

pub fn predict<M: RawColumns<f64> + ?Sized>(
    &self,
    x: &M
) -> Result<Vec<f64>, FitError>

Predict linear predictors using original-scale parameters and raw columns.

Errors

Reject feature-count mismatches, invalid entries, or nonfinite arithmetic.

preprocessing

pub fn preprocessing(&self) -> &Preprocessing

Training normalization reused by this fit.

stopping_criterion

pub fn stopping_criterion(&self) -> StoppingCriterion

The absolute KKT stopping criterion used for this fit.

stopping_threshold

pub fn stopping_threshold(&self) -> f64

Absolute KKT threshold.

stopping_value

pub fn stopping_value(&self) -> f64

Final full-loss KKT violation.

termination

pub fn termination(&self) -> Termination

Whether a full KKT check passed or the outer iteration budget expired.

working_set_diagnostics

pub fn working_set_diagnostics(&self) -> &shrinkage::WorkingSetDiagnostics

Work performed by heuristic feature selection, separate from safe screening.

Implementation of Clone

impl Clone for IrlsFit

clone

fn clone(&self) -> Self

Implementation of Debug

impl Debug for IrlsFit

fmt

fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result

Implementation of ValidationFit

impl ValidationFit for shrinkage::IrlsFit

predict

fn predict<M: RawColumns<f64> + ?Sized>(
    &self,
    design: &M
) -> Result<Vec<f64>, FitError>

termination

fn termination(&self) -> Termination

Implementation of Freeze

impl Freeze for IrlsFit

Implementation of RefUnwindSafe

impl RefUnwindSafe for IrlsFit

Implementation of Send

impl Send for IrlsFit

Implementation of Sync

impl Sync for IrlsFit

Implementation of Unpin

impl Unpin for IrlsFit

Implementation of UnsafeUnpin

impl UnsafeUnpin for IrlsFit

Implementation of UnwindSafe

impl UnwindSafe for IrlsFit

Implementation of Any

impl<T> Any for T where T: 'static + ?Sized

Implementation of Borrow

impl<T> Borrow<T> for T where T: ?Sized

Implementation of BorrowMut

impl<T> BorrowMut<T> for T where T: ?Sized

Implementation of ByRef

impl<T> ByRef<T> for T

Implementation of CastableFrom

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT where ST: ?Sized, DT: ?Sized

Implementation of CastableFrom

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT where ST: ?Sized, DT: ?Sized

Implementation of CloneToUninit

impl<T> CloneToUninit for T where T: Clone

Implementation of From

impl<T> From<T> for T

Implementation of Imply

impl<T, U> Imply<T> for U where T: ?Sized, U: ?Sized

Implementation of Into

impl<T, U> Into<U> for T where U: From<T>

Implementation of IntoEither

impl<T> IntoEither for T

Implementation of Pointable

impl<T> Pointable for T

Implementation of Read

impl<T> Read<Exclusive, BecauseExclusive> for T where T: ?Sized

Implementation of Same

impl<T> Same for T

Implementation of SupersetOf

impl<SS, SP> SupersetOf<SS> for SP where SS: SubsetOf<SP>

Implementation of ToOwned

impl<T> ToOwned for T where T: Clone

Implementation of TryFrom

impl<T, U> TryFrom<U> for T where U: Into<T>

Implementation of TryInto

impl<T, U> TryInto<U> for T where U: TryFrom<T>