19
19
from ..base import MultiOutputMixin , RegressorMixin , _fit_context
20
20
from ..model_selection import check_cv
21
21
from ..utils import check_array , check_scalar
22
- from ..utils ._param_validation import Interval , StrOptions
22
+ from ..utils ._param_validation import Interval , StrOptions , validate_params
23
23
from ..utils .extmath import safe_sparse_dot
24
24
from ..utils .parallel import Parallel , delayed
25
25
from ..utils .validation import (
@@ -344,6 +344,25 @@ def lasso_path(
344
344
)
345
345
346
346
347
+ @validate_params (
348
+ {
349
+ "X" : ["array-like" , "sparse matrix" ],
350
+ "y" : ["array-like" , "sparse matrix" ],
351
+ "l1_ratio" : [Interval (Real , 0.0 , 1.0 , closed = "both" )],
352
+ "eps" : [Interval (Real , 0.0 , None , closed = "neither" )],
353
+ "n_alphas" : [Interval (Integral , 1 , None , closed = "left" )],
354
+ "alphas" : ["array-like" , None ],
355
+ "precompute" : [StrOptions ({"auto" }), "boolean" , "array-like" ],
356
+ "Xy" : ["array-like" , None ],
357
+ "copy_X" : ["boolean" ],
358
+ "coef_init" : ["array-like" , None ],
359
+ "verbose" : ["verbose" ],
360
+ "return_n_iter" : ["boolean" ],
361
+ "positive" : ["boolean" ],
362
+ "check_input" : ["boolean" ],
363
+ },
364
+ prefer_skip_nested_validation = True ,
365
+ )
347
366
def enet_path (
348
367
X ,
349
368
y ,
@@ -408,7 +427,7 @@ def enet_path(
408
427
n_alphas : int, default=100
409
428
Number of alphas along the regularization path.
410
429
411
- alphas : ndarray , default=None
430
+ alphas : array-like , default=None
412
431
List of alphas where to compute the models.
413
432
If None alphas are set automatically.
414
433
@@ -426,7 +445,7 @@ def enet_path(
426
445
copy_X : bool, default=True
427
446
If ``True``, X will be copied; else, it may be overwritten.
428
447
429
- coef_init : ndarray of shape (n_features, ), default=None
448
+ coef_init : array-like of shape (n_features, ), default=None
430
449
The initial values of the coefficients.
431
450
432
451
verbose : bool or int, default=False
0 commit comments