Shrinkage

shrinkage::HybridFit

Shrinkage for Rust · rust · 0.3.0

pub struct HybridFit

Original-scale parameters and full-space hybrid diagnostics.

Cluster labels and values refer to optimization-scale coefficients. Clustered lasso orders blocks by value; chain fused lasso orders contiguous segments by feature and retains zero-weight edges as segment boundaries. SLOPE orders equal-magnitude blocks decreasingly and retains individual signs in Self::coefficient_signs. Scaling can change equalities among the reported original-scale parameters. Gap Safe certificates refer to the original loss and full design. A sweep that leaves all blocks unchanged does not certify convergence; check Self::termination and the full mapping.

Inherent implementation

impl HybridFit

backtracks

pub fn backtracks(&self) -> usize

Number of rejected trials followed by a curvature doubling.

cluster_labels

pub fn cluster_labels(&self) -> &[usize]

Cluster label of each feature, indexing Self::cluster_values.

cluster_values

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

Optimization-scale block values, with positive zeros. Clustered lasso returns strictly increasing values. Chain fused lasso returns signed segment values in feature order, which may repeat. SLOPE returns strictly decreasing nonnegative magnitudes, with zero last when present. For SLOPE, coefficient j on the optimization scale equals coefficient_signs()[j] * cluster_values()[cluster_labels()[j]]. Equal original-scale values need not share a label when training scales differ.

coefficient_signs

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

Optimization-scale coefficient signs in feature order: -1, 0, or 1. Both signed zeros have sign zero. Signs are recorded before coefficient back-transformation; SLOPE clusters may contain both nonzero signs.

coefficients

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

Original-scale coefficients in training-column order.

coordinate_sweeps

pub fn coordinate_sweeps(&self) -> usize

Number of cluster-coordinate sweeps over the current working set.

diagnostic_checks

pub fn diagnostic_checks(&self) -> usize

Number of refreshed inner diagnostic checks. Logistic checks use the fixed-zero quadratic subproblem; original-loss checks also run initially and after every accepted outer step.

dual_certificate

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

Original-space feasible dual vector from the latest certificate check. Screening-disabled fits do not construct a certificate.

dual_objective

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

Dual objective D(theta), when a certificate is available.

duality_gap

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

Duality gap G(beta_0, beta, theta) = P(beta_0, beta) - D(theta). This diagnostic does not replace the full mapping stopping rule.

intercept

pub fn intercept(&self) -> f64

Original-scale intercept, including the centering correction.

iterations

pub fn iterations(&self) -> usize

Total committed PG transitions plus coordinate sweeps over the current working set.

objective

pub fn objective(&self) -> f64

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

outer_backtracks

pub fn outer_backtracks(&self) -> usize

Rejected logistic trials followed by a step halving. Zero for Gaussian.

outer_iterations

pub fn outer_iterations(&self) -> usize

Accepted logistic IRLS steps. Zero for Gaussian fits.

pg_steps

pub fn pg_steps(&self) -> usize

Number of committed PG transitions, excluding diagnostic proxes.

predict

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

Predict linear predictors with original-scale parameters without fitting preprocessing. Binomial predictions are logits.

Errors

Reject mismatched dimensions, invalid entries, or nonfinite arithmetic.

preprocessing

pub fn preprocessing(&self) -> &Preprocessing

Training normalization retained for interpreting optimization values.

screening_diagnostics

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

Work and certified zero restrictions in the original feature space.

step_policy

pub fn step_policy(&self) -> HybridStep

Curvature policy selected for this fit.

step_size

pub fn step_size(&self) -> f64

Step used by final full-space diagnostics. Gaussian fits use the final PG curvature; logistic fits use a fixed global logistic curvature bound.

stopping_criterion

pub fn stopping_criterion(&self) -> StoppingCriterion

Selected full-space convergence criterion.

stopping_threshold

pub fn stopping_threshold(&self) -> f64

Absolute mapping threshold used to certify convergence.

stopping_value

pub fn stopping_value(&self) -> f64

Full mapping infinity norm, including the free-intercept derivative, evaluated for the original loss at the returned parameters using Self::step_size. Logistic surrogate checks never certify convergence.

termination

pub fn termination(&self) -> Termination

Whether the full mapping passed or the 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 HybridFit

clone

fn clone(&self) -> Self

Implementation of Debug

impl Debug for HybridFit

fmt

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

Implementation of ValidationFit

impl ValidationFit for shrinkage::HybridFit

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 HybridFit

Implementation of RefUnwindSafe

impl RefUnwindSafe for HybridFit

Implementation of Send

impl Send for HybridFit

Implementation of Sync

impl Sync for HybridFit

Implementation of Unpin

impl Unpin for HybridFit

Implementation of UnsafeUnpin

impl UnsafeUnpin for HybridFit

Implementation of UnwindSafe

impl UnwindSafe for HybridFit

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>