Skip to content

Commit fb4cd15

Browse files
committed
Merge branch 'main' of github.com:scikit-learn-contrib/skglm into internalize-jit-compilation
2 parents 4d9780e + 9c37cd7 commit fb4cd15

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

.github/workflows/flake8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
- name: Check doc style with pydocstyle
3131
run: |
3232
pip install pydocstyle
33-
pydocstyle skglm --ignore='D100',D102,'D104','D107','D203','D213','D413'
33+
pydocstyle skglm --ignore='D100',D102,'D104','D105','D107','D203','D213','D413',

skglm/estimators.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

449454
class 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

612622
class 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

766781
class 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

952972
class 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

13751400
class MultiTaskLasso(RegressorMixin, LinearModel):
13761401
r"""MultiTaskLasso estimator.

0 commit comments

Comments
 (0)