6.2.14. scikits.learn.linear_model.lars_path¶
- scikits.learn.linear_model.lars_path(X, y, Xy=None, Gram=None, max_features=None, alpha_min=0, method='lar', overwrite_X=False, overwrite_Gram=False, verbose=False)¶
Compute Least Angle Regression and LASSO path
Parameters : X: array, shape: (n_samples, n_features) :
Input data
y: array, shape: (n_samples) :
Input targets
max_features: integer, optional :
Maximum number of selected features.
Gram: array, shape: (n_features, n_features), optional :
Precomputed Gram matrix (X’ * X)
alpha_min: float, optional :
Minimum correlation along the path. It corresponds to the regularization parameter alpha parameter in the Lasso.
method: ‘lar’ | ‘lasso’ :
Specifies the returned model. Select ‘lar’ for Least Angle Regression, ‘lasso’ for the Lasso.
Returns : alphas: array, shape: (max_features + 1,) :
Maximum of covariances (in absolute value) at each iteration.
active: array, shape (max_features,) :
Indices of active variables at the end of the path.
coefs: array, shape (n_features, max_features+1) :
Coefficients along the path
See also
LassoLARS, LARS
Notes