Shrinkage

shrinkage::experimental::fit_buffered

Shrinkage for Rust · rust · 0.3.0

pub fn fit_buffered<M, D, P>(
    problem: &shrinkage::Problem<&M, D, P>,
    options: &shrinkage::ProximalGradient<Vec<f64>>,
    block_shape: [usize; 2],
    buffer: &mut [f64]
) -> Result<shrinkage::ProximalFit, shrinkage::FitError<<M as >::Error>> where M: ReadBlock<f64> + ColumnStats<f64> + ?Sized, D: SmoothDatafit, P: ProximalPenalty

Fit with existing proximal-gradient iteration over caller-buffered blocks.

Finite-entry validation and product passes reuse buffer. Normalization statistics use the underlying backend and may allocate their own workspace. Partial products and failed blocks are discarded; a retry can reuse the same buffer. The returned fit retains original-scale coefficients and training preprocessing. Its regular predict method still requires borrowed columns.

Errors

Preserves backend errors during validation, statistics, and products, and forwards the regular proximal solver's input and numerical errors.

Panics

Panics for invalid block dimensions or insufficient buffer length, as in BufferedDesign::new.