# shrinkage.PathFit

Shrinkage for Python · 0.2.0

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

Bases: `typing.Generic[shrinkage.path.FitT]`

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

```python
PathFit(
    _native: shrinkage._shrinkage._ModelPath,
    _wrap: collections.abc.Callable[[_shrinkage._ModelFit], shrinkage.path.FitT]
)
```

Owned path in fitting order, with a complete result at every point.

`fits[i]` exposes every single-fit diagnostic and prediction method. `penalties[i]` retains both fusion strengths and all edge or rank weights. Finite iteration-limit points remain in the path and warm-start the next point. A fitting error raises without returning a partial path. Results retain no training arrays. Returned arrays are independent copies.

<a id="family"></a>

## `family`

```python
family(self) -> Family
```

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

Gaussian means or binomial logits, consistent across all points.

<a id="solver"></a>

## `solver`

```python
solver(self) -> typing.Literal["hybrid", "proximal_gradient"]
```

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

Explicit numerical method used for every point, including empty paths.

<a id="n_features"></a>

## `n_features`

```python
n_features(self) -> int
```

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

Training column count, retained even for an empty path.

<a id="fits"></a>

## `fits`

```python
fits(self) -> tuple[shrinkage.path.FitT, ...]
```

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

Per-point owned fits, aligned with `penalties` and parameter rows.

<a id="penalties"></a>

## `penalties`

```python
penalties(self) -> tuple[ClusteredLasso | ChainFusedLasso | Slope, ...]
```

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

Complete immutable penalty settings for each fitted point.

<a id="coefficients"></a>

## `coefficients`

```python
coefficients(self) -> FloatArray
```

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

Original-scale float64 coefficients, shape `(n_points, n_features)`.

<a id="intercepts"></a>

## `intercepts`

```python
intercepts(self) -> FloatArray
```

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

Original-scale float64 intercepts, shape `(n_points,)`.

<a id="lambdas"></a>

## `lambdas`

```python
lambdas(self) -> FloatArray | None
```

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

Automatic scalar multipliers, shape `(n_points,)`; explicit: `None`.

<a id="maximum_penalty"></a>

## `maximum_penalty`

```python
maximum_penalty(self) -> float | None
```

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

True zero threshold: finite or `inf` for automatic paths; else `None`.

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

## `lambda_start`

```python
lambda_start(self) -> float | None
```

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

Used automatic anchor, including an override; explicit paths: `None`.

<a id="termination"></a>

## `termination`

```python
termination(self) -> shrinkage.PathTermination
```

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

Path completion or early stopping, independent of point convergence.

<a id="null_deviance"></a>

## `null_deviance`

```python
null_deviance(self) -> float | None
```

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

Averaged automatic-path null-model deviance; explicit paths: `None`.

<a id="deviances"></a>

## `deviances`

```python
deviances(self) -> FloatArray | None
```

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

Automatic fitted deviances, shape `(n_points,)`; explicit: `None`.

<a id="predict"></a>

## `predict`

```python
predict(x: object, *, copy: bool = True) -> FloatArray
```

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

Predict float64 means or logits, shape `(n_samples, n_points)`.

Columns follow path order, including duplicates. Empty batches and empty paths retain both axes. The dense input and copying rules match single fits. Inputs are copied once before Rust releases the GIL, and must remain unchanged until return. Prediction never refits transforms.
