Whether to return the number of iterations or not. positive : bool, default=False If set to True, forces coefficients to be positive. (Only allowed when ``y.ndim == 1``). check_input : bool, default=True If set to False, the input validation checks are skipped (including the Gram matrix when provided). It is assumed that they are handled by the caller. **params : kwargs Keyword arguments passed to the coordinate descent solver. Returns ------- alphas : ndarray of shape (n_alphas,) The alphas along the path where models are computed. coefs : ndarray of shape (n_features, n_alphas) or (n_targets, n_features, n_alphas) Coefficients along the path. dual_gaps : ndarray of shape (n_alphas,) The dual gaps at the end of the optimization for each alpha. n_iters : list of int The number of iterations taken by the coordinate descent optimizer to reach the specified tolerance for each alpha. (Is returned when ``return_n_iter`` is set to True). See Also -------- MultiTaskElasticNet : Multi-task ElasticNet model trained with L1/L2 mixed-norm as regularizer. MultiTaskElasticNetCV : Multi-task L1/L2 ElasticNet with built-in cross-validation. ElasticNet : Linear regression with combined L1 and L2 priors as regularizer. ElasticNetCV : Elastic Net model with iterative fitting along a regularization path. Notes ----- For an example, see :ref:`examples/linear_model/plot_lasso_lasso_lars_elasticnet_path.py `. Examples -------- >>> from sklearn.linear_model import enet_path >>> from sklearn.datasets import make_regression >>> X, y, true_coef = make_regression( ... n_samples=100, n_features=5, n_informative=2, coef=True, random_state=0 ... ) >>> true_coef array([ 0. , 0. , 0. , 97.9..., 45.7...]) >>> alphas, estimated_coef, _ = enet_path(X, y, n_alphas=3) >>> alphas.shape (3,) >>> estimated_coef array([[ 0. , 0.78..., 0.56...], [ 0. , 1.12..., 0.61...], [-0. , -2.12..., -1.12...], [ 0. , 23.04..., 88.93...], [ 0. , 10.63..., 41.56...]]) rb