@@ -348,6 +348,9 @@ def enet_path(X, y, l1_ratio=0.5, eps=1e-3, n_alphas=100, alphas=None,
348348 ElasticNetCV
349349 """
350350 X = check_array (X , 'csc' , dtype = np .float64 , order = 'F' , copy = copy_X )
351+ if Xy is not None :
352+ Xy = check_array (Xy , 'csc' , dtype = np .float64 , order = 'F' , copy = False ,
353+ ensure_2d = False )
351354 n_samples , n_features = X .shape
352355
353356 multi_output = False
@@ -389,7 +392,6 @@ def enet_path(X, y, l1_ratio=0.5, eps=1e-3, n_alphas=100, alphas=None,
389392 if selection not in ['random' , 'cyclic' ]:
390393 raise ValueError ("selection should be either random or cyclic." )
391394 random = (selection == 'random' )
392- models = []
393395
394396 if not multi_output :
395397 coefs = np .empty ((n_features , n_alphas ), dtype = np .float64 )
@@ -414,6 +416,7 @@ def enet_path(X, y, l1_ratio=0.5, eps=1e-3, n_alphas=100, alphas=None,
414416 model = cd_fast .enet_coordinate_descent_multi_task (
415417 coef_ , l1_reg , l2_reg , X , y , max_iter , tol , rng , random )
416418 elif isinstance (precompute , np .ndarray ):
419+ precompute = check_array (precompute , 'csc' , dtype = np .float64 , order = 'F' )
417420 model = cd_fast .enet_coordinate_descent_gram (
418421 coef_ , l1_reg , l2_reg , precompute , Xy , y , max_iter ,
419422 tol , rng , random , positive )
@@ -1418,6 +1421,7 @@ def __init__(self, l1_ratio=0.5, eps=1e-3, n_alphas=100, alphas=None,
14181421 self .random_state = random_state
14191422 self .selection = selection
14201423
1424+
14211425###############################################################################
14221426# Multi Task ElasticNet and Lasso models (with joint feature selection)
14231427
0 commit comments