Shrinkage

shrinkage::ProximalFit

Shrinkage for Rust · rust · 0.3.0

pub struct ProximalFit

Owned original-scale parameters and proximal-gradient diagnostics.

The objective and mapping use optimization-scale coefficients. Supported screened fits additionally report an original-problem dual certificate.

Inherent implementation

impl ProximalFit

coefficients

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

Original-scale coefficients, in training-column order.

dual_certificate

pub fn dual_certificate(&self) -> Option<&[f64]>

Feasible observation-scale dual vector, when screening was supported.

dual_objective

pub fn dual_objective(&self) -> Option<f64>

Dual objective D(theta), when a certificate was constructed.

duality_gap

pub fn duality_gap(&self) -> Option<f64>

Padded G(beta_0, beta, theta), independently of stopping choice.

intercept

pub fn intercept(&self) -> f64

Original-scale intercept, including the correction for centering.

iterations

pub fn iterations(&self) -> usize

Number of accepted proximal updates.

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 from raw columns using original-scale parameters.

Errors

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

preprocessing

pub fn preprocessing(&self) -> &Preprocessing

Training normalization metadata, reused for predictions.

screening_diagnostics

pub fn screening_diagnostics(&self) -> &shrinkage::ScreeningDiagnostics

Work and dimension reductions certified by Gap Safe screening.

step_size

pub fn step_size(&self) -> f64

Step that passed the final smooth quadratic-bound check.

stopping_criterion

pub fn stopping_criterion(&self) -> StoppingCriterion

Criterion selected for this fit.

stopping_threshold

pub fn stopping_threshold(&self) -> f64

Absolute mapping threshold used to certify convergence.

stopping_value

pub fn stopping_value(&self) -> f64

Infinity norm of (beta - prox(beta - step * gradient)) / step, maximized with the absolute unpenalized intercept derivative. Evaluated at the returned parameters, using Self::step_size.

termination

pub fn termination(&self) -> Termination

Whether the fit converged or exhausted its iteration budget.

Implementation of Clone

impl Clone for ProximalFit

clone

fn clone(&self) -> Self

Implementation of Debug

impl Debug for ProximalFit

fmt

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

Implementation of ValidationFit

impl ValidationFit for shrinkage::ProximalFit

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 ProximalFit

Implementation of RefUnwindSafe

impl RefUnwindSafe for ProximalFit

Implementation of Send

impl Send for ProximalFit

Implementation of Sync

impl Sync for ProximalFit

Implementation of Unpin

impl Unpin for ProximalFit

Implementation of UnsafeUnpin

impl UnsafeUnpin for ProximalFit

Implementation of UnwindSafe

impl UnwindSafe for ProximalFit

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>