Multi-task Lasso model trained with Orthogonally Weighted L_{2,1} (OWL) regularizer. The model optimizes the following objective function:
where
The class OrthogonallyWeightedL21
implements a direct variable metric proximal gradient iterative minimization algorithm with optional choice of OrthogonallyWeightedL21Continuation
implements a numerical continuation strategy for the relaxed problem
for a sequence of
For more information on this model, please refer to "Orthogonally weighted
-
alpha
(float, default=None): Regularization parameter$\alpha$ . Defaults to None in which case a heuristic formula is used. If noise_level is set, the value will only be used for initialization, and then adapted according to a discrepancy principle. -
noise_level
(float, default=None): Estimated noise level$\delta$ . If set to a positive value,$\alpha$ will be adapted until$\tau_1 \delta \leq ||Y - AX|| \leq \tau_2 \delta$ . -
max_iter
(int, default=1000): The maximum number of iterations, including failed updates. -
tol
(float, default=1e-4): The tolerance for the optimization based on the objective functional. The optimization code checks a termination criterion for optimality and continues until it is smaller thantol
. -
gamma
(float, default=1): The initial value of the continuation parameter$\gamma$ that will be used (only OrthogonallyWeightedL21Continuation). -
gamma_tol
(float, default=1e-6): The smallest value of the continuation parameter$\gamma$ that will be used (only OrthogonallyWeightedL21Continuation). -
normalize
(bool, default=False): If True, the regressors A will be normalized before regression by subtracting the mean and dividing by the l2-norm. Warning: this decreases the spark of A. -
data_SVD_cutoff
(float, default=None): If set to a non-negative number, a singular value decomposition will be preformed and the data vectorY
will be replaced with a full rankY_reduced
of dimension(n_features, n_targets_reduced)
withY
approximatingY_reduced @ Q
for some orthogonalQ
with$|| Y_{reduced} Q - Y ||$ smaller thandata_SVD_cutoff
. The problem will be solved on the reduced representation withn_targets_reduced
. -
warm_start
(bool, default=False): When set toTrue
, reuse the solution of the previous call to fit as initialization. Otherwise, erase the previous solution and perform random or zero initialization. -
verbose
(int, default=False): Print information on updates. When set toTrue
, prints at every step. When set to a integerN
, prints everyN
steps.
coef_
(ndarray of shape (n_features, n_targets)): Parameter vector (Z in the cost function formula). If a 1D data array Y is passed in at fit (non multi-task usage),coef_
is then a 1D array.
from base import OrthogonallyWeightedL21
import numpy as np
owl = OrthogonallyWeightedL21(noise_level=0.0001,
tol=1e-4,
max_iter=5000,
verbose=True)
A = np.array([[0.2, 1., 0., 0., 0.],
[0.2, 0., 1., 0., 0.],
[0., 0., 0., 1., 0.],
[0., 0., 0., 0., 1.]])
X = np.array([[0., 0., 0., 1., 1.],
[0., 0., 0., 1., -1.]]).transpose()
Y = A @ X
owl.fit(A, Y)
print('Z = ', owl.coef_)
print('singular values = ', np.linalg.svd(owl.coef_, full_matrices=False)[1])
print('fit = ', np.linalg.norm(A @ owl.coef_ - Y))