# shrinkage::PathOptions

Shrinkage for Rust · 0.3.0

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

```rust
pub struct PathOptions
```

Options for a decreasing, log-spaced automatic regularization sequence. 

Defaults to 100 points and an endpoint ratio of `0.01` when observations are fewer than features, or `0.0001` otherwise. Automatic paths stop early on deviance by default, after at least five points. Disable early stopping to fit the entire sequence. Losses without deviance support fit every point. Options are checked when fitting. A zero start generates zero strengths. 

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

## Inherent implementation

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

```rust
impl PathOptions
```

<a id="method-deviance_change_tolerance-6fbf32d1f8c5207075145d3a72e3b77286d7a25bbe911265bcca4d57d978b02c"></a>

### `deviance_change_tolerance`

```rust
pub fn deviance_change_tolerance(self, tolerance: f64) -> Self
```

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

Stop below this fractional decrease in consecutive deviances (`1e-5`). Zero disables this criterion. Only converged, nonincreasing fits qualify. 

<a id="method-deviance_ratio_tolerance-6fbf32d1f8c5207075145d3a72e3b77286d7a25bbe911265bcca4d57d978b02c"></a>

### `deviance_ratio_tolerance`

```rust
pub fn deviance_ratio_tolerance(self, tolerance: f64) -> Self
```

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

Stop at this explained fraction of null deviance; defaults to `0.999`. 

<a id="method-early_stopping-6fbf32d1f8c5207075145d3a72e3b77286d7a25bbe911265bcca4d57d978b02c"></a>

### `early_stopping`

```rust
pub fn early_stopping(self, enabled: bool) -> Self
```

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

Enable deviance-based early stopping for automatic paths (the default). 

<a id="method-lambda_min_ratio-6fbf32d1f8c5207075145d3a72e3b77286d7a25bbe911265bcca4d57d978b02c"></a>

### `lambda_min_ratio`

```rust
pub fn lambda_min_ratio(self, ratio: f64) -> Self
```

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

Set the finite endpoint ratio in `(0, 1]`. 

<a id="method-lambda_start-6fbf32d1f8c5207075145d3a72e3b77286d7a25bbe911265bcca4d57d978b02c"></a>

### `lambda_start`

```rust
pub fn lambda_start(self, value: f64) -> Self
```

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

Override the starting value with a finite, nonnegative strength. The result still records the independently calculated true threshold. 

<a id="method-min_points-6fbf32d1f8c5207075145d3a72e3b77286d7a25bbe911265bcca4d57d978b02c"></a>

### `min_points`

```rust
pub fn min_points(self, count: usize) -> Self
```

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

Require this many fitted points before early stopping; defaults to five. Shorter requested sequences are fitted completely. 

<a id="method-new-6fbf32d1f8c5207075145d3a72e3b77286d7a25bbe911265bcca4d57d978b02c"></a>

### `new`

```rust
pub fn new() -> Self
```

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

Use the default sequence length and dimension-dependent endpoint ratio. 

<a id="method-nlambda-6fbf32d1f8c5207075145d3a72e3b77286d7a25bbe911265bcca4d57d978b02c"></a>

### `nlambda`

```rust
pub fn nlambda(self, count: usize) -> Self
```

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

Set a strictly positive number of points; one returns the starting value. 

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

## Implementation of Clone

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

```rust
impl Clone for PathOptions
```

<a id="method-clone-8b1e6e4342c2358cd66142852a83b5b46fd4da1c0d31980a9518f7fb1413a9d2"></a>

### `clone`

```rust
fn clone(&self) -> Self
```

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

<a id="impl-467e873bf08a0ce9c689f4d72d8c5ef610cfedaedebf2542c641f4cd35f052d9"></a>

## Implementation of Copy

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

```rust
impl Copy for PathOptions
```

<a id="impl-8026e1e925ed32a858b2463170dac7e4bb5836fc96cf899b3848c16e541222df"></a>

## Implementation of Debug

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

```rust
impl Debug for PathOptions
```

<a id="method-fmt-8026e1e925ed32a858b2463170dac7e4bb5836fc96cf899b3848c16e541222df"></a>

### `fmt`

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

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

<a id="impl-458e3167cdaa0275ae46903e2b73c1ef30b9b7495e3e34293611d28b11579df0"></a>

## Implementation of Default

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

```rust
impl Default for PathOptions
```

<a id="method-default-458e3167cdaa0275ae46903e2b73c1ef30b9b7495e3e34293611d28b11579df0"></a>

### `default`

```rust
fn default() -> Self
```

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

<a id="impl-0421960fbfd2c5c561b51e29fe8b5d8d2ab9f2cd2e577918b6aa2f514d8ac590"></a>

## Implementation of Freeze

```rust
impl Freeze for PathOptions
```

<a id="impl-975b0f64e03149a5a77f23637524d3da0c72fa833babae0d9604e653e75d4b5e"></a>

## Implementation of RefUnwindSafe

```rust
impl RefUnwindSafe for PathOptions
```

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

## Implementation of Send

```rust
impl Send for PathOptions
```

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

## Implementation of Sync

```rust
impl Sync for PathOptions
```

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

## Implementation of Unpin

```rust
impl Unpin for PathOptions
```

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

## Implementation of UnsafeUnpin

```rust
impl UnsafeUnpin for PathOptions
```

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

## Implementation of UnwindSafe

```rust
impl UnwindSafe for PathOptions
```

<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-86d7da2bfd1140cc1675dfe6a975e6a2762338ab32731152da0723858ef3aa81"></a>

## Implementation of CloneToUninit

```rust
impl<T> CloneToUninit for T where T: Clone
```

<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-a8ef6e94191301c3685488478f4905086c47137bac2d606ea4d09631d5472b06"></a>

## Implementation of ToOwned

```rust
impl<T> ToOwned for T where T: Clone
```

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