Shrinkage

shrinkage::RuntimeDesign

Shrinkage for Rust · rust · 0.3.0

pub trait RuntimeDesign

Object-safe preparation of a runtime-selected design.

Entry validation and generic column views remain in the concrete adapter. Preparation allocates reusable native product buffers once per fit and resolves automatic normalization using the selected datafit's intercept.

Methods

ncols

fn ncols(&self) -> usize

Number of training features.

nrows

fn nrows(&self) -> usize

Number of training observations.

prepare

fn prepare(
    &self,
    normalization: Normalization,
    centers: Option<&[f64]>,
    scales: Option<&[f64]>,
    fit_intercept: bool
) -> Result<Box<dyn ProximalDesign<Error = BackendError> + '_>, FitError<BackendError>>

Validate the design and prepare its normalized product oracle.

Errors

Reject invalid data or normalization vectors and preserve failures from backend statistics with their operation context and source.

Implementation of RuntimeDesign

impl<M, V> RuntimeDesign for MatrixDesign<'_, M, V> where M: RawColumns<f64> + ColumnStats<f64> + MatVecInto<V> + MatTransposeVecInto<V> + ?Sized, <M as >::Error: Error + 'static, V: ProximalVector + 'static