Datafits
A datafit defines the loss on the complete linear predictor, including the intercept. Matrix operations belong to the design. Loss values and derivatives use the same averaging convention.
Datafit | Response | Loss | Compatible solvers |
|---|---|---|---|
One finite real response per observation | Averaged squared error | Coordinate descent for L1, proximal gradient, IRLS, hybrid for supported penalties | |
Finite values in | Averaged Bernoulli negative log likelihood | Proximal gradient, IRLS, hybrid for supported penalties | |
Multiple finite response columns | Squared error, summed over responses and averaged over observations | Proximal gradient with AxisPenalty |
All three fit unpenalized intercepts by default. Response dimensions must match nonempty training observations. Data and parameters are validated when losses are evaluated or models are fitted.
shrinkage::Datafit supplies loss evaluation. DifferentiableDatafit adds gradients and observation metadata. shrinkage::SmoothDatafit asserts convexity, and shrinkage::DiagonalHessianDatafit supplies exact, potentially signed second derivatives. QuadraticModelDatafit supplies nonnegative working curvature to IRLS. These capabilities determine which solvers can fit a composition.
Gaussian and binomial models also support configurable links through the typed Rust IRLS API using .with_link(...).
