@@ -449,6 +449,11 @@ def path(self, X, y, alphas, coef_init=None, return_n_iter=True, **params):
449449 warm_start = self .warm_start , verbose = self .verbose )
450450 return solver .path (X , y , datafit , penalty , alphas , coef_init , return_n_iter )
451451
452+ def __sklearn_tags__ (self ):
453+ tags = super ().__sklearn_tags__ ()
454+ tags .input_tags .sparse = True
455+ return tags
456+
452457
453458class WeightedLasso (RegressorMixin , LinearModel ):
454459 r"""WeightedLasso estimator based on Celer solver and primal extrapolation.
@@ -612,6 +617,11 @@ def fit(self, X, y):
612617 warm_start = self .warm_start , verbose = self .verbose )
613618 return _glm_fit (X , y , self , Quadratic (), penalty , solver )
614619
620+ def __sklearn_tags__ (self ):
621+ tags = super ().__sklearn_tags__ ()
622+ tags .input_tags .sparse = True
623+ return tags
624+
615625
616626class ElasticNet (RegressorMixin , LinearModel ):
617627 r"""Elastic net estimator.
@@ -766,6 +776,11 @@ def fit(self, X, y):
766776 return _glm_fit (X , y , self , Quadratic (),
767777 L1_plus_L2 (self .alpha , self .l1_ratio , self .positive ), solver )
768778
779+ def __sklearn_tags__ (self ):
780+ tags = super ().__sklearn_tags__ ()
781+ tags .input_tags .sparse = True
782+ return tags
783+
769784
770785class MCPRegression (RegressorMixin , LinearModel ):
771786 r"""Linear regression with MCP penalty estimator.
@@ -954,6 +969,11 @@ def fit(self, X, y):
954969 warm_start = self .warm_start , verbose = self .verbose )
955970 return _glm_fit (X , y , self , Quadratic (), penalty , solver )
956971
972+ def __sklearn_tags__ (self ):
973+ tags = super ().__sklearn_tags__ ()
974+ tags .input_tags .sparse = True
975+ return tags
976+
957977
958978class SparseLogisticRegression (LinearClassifierMixin , SparseCoefMixin , BaseEstimator ):
959979 r"""Sparse Logistic regression estimator.
@@ -1381,6 +1401,11 @@ def fit(self, X, y):
13811401
13821402 return self
13831403
1404+ def __sklearn_tags__ (self ):
1405+ tags = super ().__sklearn_tags__ ()
1406+ tags .input_tags .sparse = True
1407+ return tags
1408+
13841409
13851410class MultiTaskLasso (RegressorMixin , LinearModel ):
13861411 r"""MultiTaskLasso estimator.
0 commit comments