# shrinkage.PathOptions

Shrinkage for Python · 0.2.0

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

<a id="constructor"></a>

```python
PathOptions(
    *,
    nlambda: int = 100,
    lambda_min_ratio: float | None = None,
    lambda_start: float | None = None,
    early_stopping: bool = True,
    min_points: int = 5,
    deviance_change_tolerance: float = 1e-5,
    deviance_ratio_tolerance: float = 0.999
)
```

Generate a decreasing log-spaced sequence on the optimization scale.

`nlambda` and `min_points` must be positive. The endpoint ratio is in `(0, 1]` and defaults to `0.01` when samples are fewer than features, or `0.0001` otherwise. `lambda_start` overrides the anchor without changing the reported true zero threshold. A zero anchor gives all zeros.

Early stopping requires converged points and at least `min_points` fits. The change tolerance is finite and nonnegative; zero disables that check. The explained null-deviance tolerance is in `(0, 1]`. Disable early stopping to fit every requested point. Options are validated when fitting.

<a id="nlambda"></a>

## `nlambda`

```python
nlambda: int = field(default=100, kw_only=True)
```

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

<a id="lambda_min_ratio"></a>

## `lambda_min_ratio`

```python
lambda_min_ratio: float | None = field(default=None, kw_only=True)
```

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

<a id="lambda_start"></a>

## `lambda_start`

```python
lambda_start: float | None = field(default=None, kw_only=True)
```

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

<a id="early_stopping"></a>

## `early_stopping`

```python
early_stopping: bool = field(default=True, kw_only=True)
```

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

<a id="min_points"></a>

## `min_points`

```python
min_points: int = field(default=5, kw_only=True)
```

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

<a id="deviance_change_tolerance"></a>

## `deviance_change_tolerance`

```python
deviance_change_tolerance: float = field(default=1e-5, kw_only=True)
```

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

<a id="deviance_ratio_tolerance"></a>

## `deviance_ratio_tolerance`

```python
deviance_ratio_tolerance: float = field(default=0.999, kw_only=True)
```

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