# shrinkage.HybridCoordinateDescent

Shrinkage for Python · 0.2.0

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

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

```python
HybridCoordinateDescent(
    *,
    stopping: StoppingCriterion | None = None,
    max_iterations: int = 10000,
    max_outer_iterations: int = 100,
    max_inner_iterations: int = 1000,
    max_outer_backtracks: int = 100,
    cluster_sweeps: int = 5,
    check_every: int = 10,
    screening: bool = True,
    working_set_policy: shrinkage.WorkingSetPolicy = <factory>,
    step_policy: shrinkage.HybridStep = <factory>
)
```

Coordinate descent with periodic proximal-gradient steps and binomial IRLS.

Start with a PG transition, then alternate `cluster_sweeps` block sweeps with PG. `max_iterations` counts committed PG transitions plus sweeps; logistic fits share it across quadratic subproblems. Outer iterations count accepted IRLS steps. Inner iterations limit each quadratic model. Gaussian fitting ignores the outer and inner budgets.

Checks run initially, every `check_every` iterations, and at the budget. Only the full original-loss mapping certifies convergence. `stopping=None` uses absolute mapping tolerance `1e-6`. Gap and KKT criteria are rejected. Screening and working sets are enabled independently by default.

<a id="stopping"></a>

## `stopping`

```python
stopping: StoppingCriterion | None = field(default=None, kw_only=True)
```

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

<a id="max_iterations"></a>

## `max_iterations`

```python
max_iterations: int = field(default=10_000, kw_only=True)
```

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

<a id="max_outer_iterations"></a>

## `max_outer_iterations`

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

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

<a id="max_inner_iterations"></a>

## `max_inner_iterations`

```python
max_inner_iterations: int = field(default=1_000, kw_only=True)
```

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

<a id="max_outer_backtracks"></a>

## `max_outer_backtracks`

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

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

<a id="cluster_sweeps"></a>

## `cluster_sweeps`

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

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

<a id="check_every"></a>

## `check_every`

```python
check_every: int = field(default=10, kw_only=True)
```

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

<a id="screening"></a>

## `screening`

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

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

<a id="working_set_policy"></a>

## `working_set_policy`

```python
working_set_policy: shrinkage.WorkingSetPolicy = field(
        default_factory=WorkingSetPolicy.auto, kw_only=True
    )
```

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

<a id="step_policy"></a>

## `step_policy`

```python
step_policy: shrinkage.HybridStep = field(
        default_factory=HybridStep.backtracking, kw_only=True
    )
```

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