# shrinkage::experimental::fit\_buffered

Shrinkage for Rust · 0.3.0

[Source](<https://github.com/jolars/shrinkage/blob/eeafe449edce19d3c552a03060f681ae3891af74/src/experimental.rs>)

```rust
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. 

<a id="documentation-errors"></a>

## Errors

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

<a id="documentation-panics"></a>

## Panics

Panics for invalid block dimensions or insufficient buffer length, as in [`BufferedDesign::new`](<57ec6943e8271cc50048b233386717ea48547da504ef71e742c82ec67ac252e9#method-new-a25d51879906432774b512987d85ec7bcc75fcf5d60e2b1ed19153456c49582b>).
