# shrinkage::CrossValidationError

Shrinkage for Rust · 0.3.0

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

```rust
pub enum CrossValidationError<E = std::convert::Infallible>
```

Validation or fitting failure with the fold and candidate when available. 

Errors return no partial cross-validation result. A nonconverged fit is an error, so an incomplete candidate cannot silently influence selection. 

<a id="variants"></a>

## Variants

<a id="variant-Fold"></a>

### `Fold`

```rust
Fold { fold: usize, source: shrinkage::FitError<E> }
```

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

Training, path fitting, or prediction failed in a validation fold. 

<a id="variant-Fold-field-fold"></a>

#### `fold`

```rust
fold: usize
```

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

Zero-based held-out fold identifier. 

<a id="variant-Fold-field-source"></a>

#### `source`

```rust
source: shrinkage::FitError<E>
```

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

Original validation, backend, or numerical failure. 

<a id="variant-InvalidInput"></a>

### `InvalidInput`

```rust
InvalidInput { source: shrinkage::FitError<E> }
```

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

Invalid configuration, folds, or full response. 

<a id="variant-InvalidInput-field-source"></a>

#### `source`

```rust
source: shrinkage::FitError<E>
```

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

Underlying validation failure. 

<a id="variant-NonConverged"></a>

### `NonConverged`

```rust
NonConverged { fold: Option<usize>, candidate: usize }
```

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

A path point did not meet its solver's convergence criterion. 

<a id="variant-NonConverged-field-candidate"></a>

#### `candidate`

```rust
candidate: usize
```

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

Zero-based candidate position in path order. 

<a id="variant-NonConverged-field-fold"></a>

#### `fold`

```rust
fold: Option<usize>
```

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

Held-out fold, or `None` for the full-data refit path. 

<a id="variant-Refit"></a>

### `Refit`

```rust
Refit { source: shrinkage::FitError<E> }
```

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

Fitting the full-data path failed after selection. 

<a id="variant-Refit-field-source"></a>

#### `source`

```rust
source: shrinkage::FitError<E>
```

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

Original fitting failure. 

<a id="impl-3f31553a1ab79988ac1c8f7bfae9192a7a34ffe4fe13e18d22c791146f73dd32"></a>

## Implementation of Debug

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

```rust
impl<E: core::fmt::Debug> Debug for CrossValidationError<E>
```

<a id="method-fmt-3f31553a1ab79988ac1c8f7bfae9192a7a34ffe4fe13e18d22c791146f73dd32"></a>

### `fmt`

```rust
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
```

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

<a id="impl-3c72c1d259d3af286c1416e02ec8de838c2c3531d8a2205142520328ba233204"></a>

## Implementation of Display

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

```rust
impl<E: fmt::Display> Display for CrossValidationError<E>
```

<a id="method-fmt-3c72c1d259d3af286c1416e02ec8de838c2c3531d8a2205142520328ba233204"></a>

### `fmt`

```rust
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
```

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

<a id="impl-5f6728f180a9a85f3c8280da4fe664e4e3b69981d929a0391e71e845735f25ca"></a>

## Implementation of Error

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

```rust
impl<E: Error + 'static> Error for CrossValidationError<E>
```

<a id="method-source-5f6728f180a9a85f3c8280da4fe664e4e3b69981d929a0391e71e845735f25ca"></a>

### `source`

```rust
fn source(&self) -> Option<&(dyn Error + 'static)>
```

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

<a id="impl-0a591207cfb6e8da53640b1def7f85646763c3c051de7aa3de165d7f985f523e"></a>

## Implementation of From

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

```rust
impl<E> From<FitError<E>> for CrossValidationError<E>
```

<a id="method-from-0a591207cfb6e8da53640b1def7f85646763c3c051de7aa3de165d7f985f523e"></a>

### `from`

```rust
fn from(source: FitError<E>) -> Self
```

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

<a id="impl-61118a01eb39f905c20b7ca98b769fd5a4406595ef19a9ebf9a075d0281d9383"></a>

## Implementation of Freeze

```rust
impl<E> Freeze for CrossValidationError<E> where FitError<E>: Freeze + Freeze + Freeze
```

<a id="impl-10ab9ed67d82b213294a70633894554da189b0ae6d4d0f1356496e3692fa1798"></a>

## Implementation of RefUnwindSafe

```rust
impl<E> RefUnwindSafe for CrossValidationError<E> where FitError<E>: RefUnwindSafe + RefUnwindSafe + RefUnwindSafe
```

<a id="impl-2f5e5f9f4d6983e4aa9fec1751c56901d1c108350c36f4ea1f454bf093e2bfa6"></a>

## Implementation of Send

```rust
impl<E> Send for CrossValidationError<E> where FitError<E>: Send + Send + Send
```

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

## Implementation of Sync

```rust
impl<E> Sync for CrossValidationError<E> where FitError<E>: Sync + Sync + Sync
```

<a id="impl-4b8589767ca8361c51d0bec0f0d5bdd40bbb0bd2aafdd91279bd4c2d31172722"></a>

## Implementation of Unpin

```rust
impl<E> Unpin for CrossValidationError<E> where FitError<E>: Unpin + Unpin + Unpin
```

<a id="impl-3bc3ccf2964e7443122702321c15ce1808f66d40b7ced16283828592a2d21094"></a>

## Implementation of UnsafeUnpin

```rust
impl<E> UnsafeUnpin for CrossValidationError<E> where FitError<E>: UnsafeUnpin + UnsafeUnpin + UnsafeUnpin
```

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

## Implementation of UnwindSafe

```rust
impl<E> UnwindSafe for CrossValidationError<E> where FitError<E>: UnwindSafe + UnwindSafe + UnwindSafe
```

<a id="impl-1e5682dc18e03c648aa9b125290c107c1e8d96ce8a179a8532e4057da4daf0cd"></a>

## Implementation of Any

```rust
impl<T> Any for T where T: 'static + ?Sized
```

<a id="impl-6c0b25c2c92cdb117802d9c0a4c70afc9a8bfb0da875bc6e66191e2349fcdf3f"></a>

## Implementation of Borrow

```rust
impl<T> Borrow<T> for T where T: ?Sized
```

<a id="impl-796e80d926348273a22b04d8e84f510693b11c06ec57c3c3e2e8c1524094a85c"></a>

## Implementation of BorrowMut

```rust
impl<T> BorrowMut<T> for T where T: ?Sized
```

<a id="impl-8360e4092e7ec4a05a26dd304cd739398f0cacc50c8d08dd5be0223d1a08d02e"></a>

## Implementation of ByRef

```rust
impl<T> ByRef<T> for T
```

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

## Implementation of CastableFrom

```rust
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT where ST: ?Sized, DT: ?Sized
```

<a id="impl-97b65e7dfc44b5ecaa495a3a19fe737914a1e9f8532200cf8f46191314e7d777"></a>

## Implementation of CastableFrom

```rust
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT where ST: ?Sized, DT: ?Sized
```

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

## Implementation of From

```rust
impl<T> From<T> for T
```

<a id="impl-5adf6ca1830f30fbbac655ab8ff394d254954df7ededc7cc833c72fdc87d6f00"></a>

## Implementation of Imply

```rust
impl<T, U> Imply<T> for U where T: ?Sized, U: ?Sized
```

<a id="impl-85eec431edd188129f88290bbcb748e4d2fdc97f7efef3c162b8c252286ffec0"></a>

## Implementation of Into

```rust
impl<T, U> Into<U> for T where U: From<T>
```

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

## Implementation of IntoEither

```rust
impl<T> IntoEither for T
```

<a id="impl-5655b1ef858b34a584cb80104f040c8a4063ced0d281311a0833ed12aefde86e"></a>

## Implementation of Pointable

```rust
impl<T> Pointable for T
```

<a id="impl-8cc2aa01198fc9fa44f08b889f62988d70d2a7f4f0f11f4666d4c08bdaddb22a"></a>

## Implementation of Read

```rust
impl<T> Read<Exclusive, BecauseExclusive> for T where T: ?Sized
```

<a id="impl-5ea09131039c62dd92b119d480a35c7e2b33d2b81dccf0b849f6b1f19f4bda24"></a>

## Implementation of Same

```rust
impl<T> Same for T
```

<a id="impl-7ee6ff38d6674f5edfe4734359062c2a67a572cff5899a89704764822b931c7f"></a>

## Implementation of SupersetOf

```rust
impl<SS, SP> SupersetOf<SS> for SP where SS: SubsetOf<SP>
```

<a id="impl-82080067a230190c131bfdc130e18618c470dd8f7284e287e520ecdb5ee8eea1"></a>

## Implementation of ToString

```rust
impl<T> ToString for T where T: Display + ?Sized
```

<a id="impl-83960135d00d98080c95a08867729696e36811280c2dd9cf34c1b4fe21c81e18"></a>

## Implementation of TryFrom

```rust
impl<T, U> TryFrom<U> for T where U: Into<T>
```

<a id="impl-1cc495bcaa5112ffb304e7f0de674feca391fd97f47bec86033a9225b72ac05c"></a>

## Implementation of TryInto

```rust
impl<T, U> TryInto<U> for T where U: TryFrom<T>
```
