Skip to content

Commit e3c51df

Browse files
issue#290 integrate upstream changes
2 parents 78b259c + 9c37cd7 commit e3c51df

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
@@ -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

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

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

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

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

13851410
class MultiTaskLasso(RegressorMixin, LinearModel):
13861411
r"""MultiTaskLasso estimator.

0 commit comments

Comments
 (0)