celer.celer_path

celer.celer_path(X, y, eps=0.001, n_alphas=100, alphas=None, coef_init=None, max_iter=20, gap_freq=10, max_epochs=50000, p0=10, verbose=0, verbose_inner=0, tol=1e-06, prune=0, return_thetas=False, monitor=False, X_offset=None, X_scale=None)

Compute Lasso path with Celer as inner solver.

Parameters:
X : {array-like, sparse matrix}, shape (n_samples, n_features)

Training data. Pass directly as Fortran-contiguous data or column sparse format (CSC) to avoid unnecessary memory duplication.

y : ndarray, shape (n_samples,)

Target values

eps : float, optional

Length of the path. eps=1e-3 means that alpha_min = 1e-3 * alpha_max

n_alphas : int, optional

Number of alphas along the regularization path

alphas : ndarray, optional

List of alphas where to compute the models. If None alphas are set automatically

coef_init : ndarray, shape (n_features,) | None, optional, (defualt=None)

Initial value of coefficients. If None, np.zeros(n_features) is used.

max_iter : int, optional

The maximum number of iterations (subproblem definitions)

gap_freq : int, optional

Number of coordinate descent epochs between each duality gap computations.

max_epochs : int, optional

Maximum number of CD epochs on each subproblem.

p0 : int, optional

First working set size.

verbose : bool or integer, optional

Amount of verbosity.

verbose_inner : bool or integer

Amount of verbosity in the inner solver.

tol : float, optional

The tolerance for the optimization: the solver runs until the duality gap is smaller than tol or the maximum number of iteration is reached.

prune : 0 | 1, optional

Whether or not to use pruning when growing working sets.

return_thetas : bool, optional

If True, dual variables along the path are returned.

monitor : bool, optional (default=False)

Whether to return timings and gaps for each alpha. Used only for single alpha.

X_offset : np.array, shape (n_features,), optional

Used to center sparse X without breaking sparsity. Mean of each column. See sklearn.linear_model.base._preprocess_data().

X_scale: np.array, shape (n_features,), optional

Used to scale centered sparse X without breaking sparsity. Norm of each centered column. See sklearn.linear_model.base._preprocess_data().

Returns:
alphas : array, shape (n_alphas,)

The alphas along the path where models are computed.

coefs : array, shape (n_features, n_alphas)

Coefficients along the path.

dual_gaps : array, shape (n_alphas,)

Duality gaps returned by the solver along the path.

thetas : array, shape (n_alphas, n_samples)

The dual variables along the path. (Is returned only when return_thetas is set to True).

Fork me on GitHub