@@ -445,6 +445,11 @@ def path(self, X, y, alphas, coef_init=None, return_n_iter=True, **params):
445445 warm_start = self .warm_start , verbose = self .verbose )
446446 return solver .path (X , y , datafit , penalty , alphas , coef_init , return_n_iter )
447447
448+ def __sklearn_tags__ (self ):
449+ tags = super ().__sklearn_tags__ ()
450+ tags .input_tags .sparse = True
451+ return tags
452+
448453
449454class WeightedLasso (RegressorMixin , LinearModel ):
450455 r"""WeightedLasso estimator based on Celer solver and primal extrapolation.
@@ -608,6 +613,11 @@ def fit(self, X, y):
608613 warm_start = self .warm_start , verbose = self .verbose )
609614 return _glm_fit (X , y , self , Quadratic (), penalty , solver )
610615
616+ def __sklearn_tags__ (self ):
617+ tags = super ().__sklearn_tags__ ()
618+ tags .input_tags .sparse = True
619+ return tags
620+
611621
612622class ElasticNet (RegressorMixin , LinearModel ):
613623 r"""Elastic net estimator.
@@ -762,6 +772,11 @@ def fit(self, X, y):
762772 return _glm_fit (X , y , self , Quadratic (),
763773 L1_plus_L2 (self .alpha , self .l1_ratio , self .positive ), solver )
764774
775+ def __sklearn_tags__ (self ):
776+ tags = super ().__sklearn_tags__ ()
777+ tags .input_tags .sparse = True
778+ return tags
779+
765780
766781class MCPRegression (RegressorMixin , LinearModel ):
767782 r"""Linear regression with MCP penalty estimator.
@@ -948,6 +963,11 @@ def fit(self, X, y):
948963 warm_start = self .warm_start , verbose = self .verbose )
949964 return _glm_fit (X , y , self , Quadratic (), penalty , solver )
950965
966+ def __sklearn_tags__ (self ):
967+ tags = super ().__sklearn_tags__ ()
968+ tags .input_tags .sparse = True
969+ return tags
970+
951971
952972class SparseLogisticRegression (LinearClassifierMixin , SparseCoefMixin , BaseEstimator ):
953973 r"""Sparse Logistic regression estimator.
@@ -1371,6 +1391,11 @@ def fit(self, X, y):
13711391
13721392 return self
13731393
1394+ def __sklearn_tags__ (self ):
1395+ tags = super ().__sklearn_tags__ ()
1396+ tags .input_tags .sparse = True
1397+ return tags
1398+
13741399
13751400class MultiTaskLasso (RegressorMixin , LinearModel ):
13761401 r"""MultiTaskLasso estimator.
0 commit comments