Skip to content

Commit 4cf5976

Browse files
authored
DOC - Add PDCD_WS solver to documentation (#136)
1 parent 4bee85f commit 4cf5976

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

doc/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,4 @@ Experimental
9090
:toctree: generated/
9191

9292
SqrtLasso
93+
PDCD_WS

skglm/experimental/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from .reweighted import IterativeReweightedL1
22
from .sqrt_lasso import SqrtLasso
3+
from .pdcd_ws import PDCD_WS
34

45
__all__ = [
56
SqrtLasso,
67
IterativeReweightedL1,
8+
PDCD_WS
79
]

skglm/experimental/pdcd_ws.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@
1212
class PDCD_WS:
1313
r"""Primal-Dual Coordinate Descent solver with working sets.
1414
15-
It solves::
15+
It solves
16+
17+
.. math::
1618
1719
\min_w F(Xw) + G(w)
1820
19-
using a primal-dual method on the saddle point problem::
2021
21-
\min_w \max_z <Xw, z> + G(w) - F^*(z)
22+
using a primal-dual method on the saddle point problem
23+
24+
.. math::
25+
26+
\min_w \max_z \langle Xw, z \rangle + G(w) - F^*(z)
2227
2328
where :math:`F` is the datafit term (:math:`F^*` its Fenchel conjugate)
2429
and :math:`G` is the penalty term.
@@ -29,11 +34,14 @@ class PDCD_WS:
2934
The solver is an adaptation of algorithm [1] to working sets [2].
3035
The working sets are built using a fixed point distance strategy
3136
where each feature is assigned a score based how much its coefficient varies
32-
when performing a primal update::
37+
when performing a primal update
38+
39+
.. math::
3340
34-
\text{score}_j = \abs{w_j - prox_{\tau_j, G_j}(w_j - \tau_j <X_j, z>)}
41+
\mathrm{score}_j = \lvert w_j -
42+
\mathrm{prox}_{\tau_j, G_j}(w_j - \tau_j \langle X_j, z \rangle) \rvert
3543
36-
where :maths:`\tau_j` is the primal step associated with the j-th feature.
44+
where :math:`\tau_j` is the primal step associated with the j-th feature.
3745
3846
Parameters
3947
----------
@@ -46,7 +54,7 @@ class PDCD_WS:
4654
4755
dual_init : array, shape (n_samples,) default None
4856
The initialization of dual variables.
49-
If None, they are initialized as the 0 vector ``np.zeros(n_samples)``.
57+
If ``None``, they are initialized as the 0 vector ``np.zeros(n_samples)``.
5058
5159
p0 : int, optional
5260
First working set size.

0 commit comments

Comments
 (0)