# shrinkage::RuntimeDesign

Shrinkage for Rust · 0.3.0

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

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

<a id="methods"></a>

## Methods

<a id="method-ncols"></a>

### `ncols`

```rust
fn ncols(&self) -> usize
```

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

Number of training features. 

<a id="method-nrows"></a>

### `nrows`

```rust
fn nrows(&self) -> usize
```

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

Number of training observations. 

<a id="method-prepare"></a>

### `prepare`

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

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

Validate the design and prepare its normalized product oracle. 

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

#### Errors

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

<a id="impl-d2a6233f98f70abe5a6376700d0519a5f54f86f80ca68050fcfc6ded18fa0179"></a>

## [Implementation of RuntimeDesign](<87877080e6d8127e48166e3cbed062c7ff789669a6c296a69957c065250fe2af>)

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

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