Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
25 changes: 25 additions & 0 deletions skglm/estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,11 @@ def path(self, X, y, alphas, coef_init=None, return_n_iter=True, **params):
warm_start=self.warm_start, verbose=self.verbose)
return solver.path(X, y, datafit, penalty, alphas, coef_init, return_n_iter)

def __sklearn_tags__(self):
tags = super().__sklearn_tags__()
tags.input_tags.sparse = True
return tags


class WeightedLasso(RegressorMixin, LinearModel):
r"""WeightedLasso estimator based on Celer solver and primal extrapolation.
Expand Down Expand Up @@ -611,6 +616,11 @@ def fit(self, X, y):
warm_start=self.warm_start, verbose=self.verbose)
return _glm_fit(X, y, self, Quadratic(), penalty, solver)

def __sklearn_tags__(self):
tags = super().__sklearn_tags__()
tags.input_tags.sparse = True
return tags


class ElasticNet(RegressorMixin, LinearModel):
r"""Elastic net estimator.
Expand Down Expand Up @@ -765,6 +775,11 @@ def fit(self, X, y):
return _glm_fit(X, y, self, Quadratic(),
L1_plus_L2(self.alpha, self.l1_ratio, self.positive), solver)

def __sklearn_tags__(self):
tags = super().__sklearn_tags__()
tags.input_tags.sparse = True
return tags


class MCPRegression(RegressorMixin, LinearModel):
r"""Linear regression with MCP penalty estimator.
Expand Down Expand Up @@ -953,6 +968,11 @@ def fit(self, X, y):
warm_start=self.warm_start, verbose=self.verbose)
return _glm_fit(X, y, self, Quadratic(), penalty, solver)

def __sklearn_tags__(self):
tags = super().__sklearn_tags__()
tags.input_tags.sparse = True
return tags


class SparseLogisticRegression(LinearClassifierMixin, SparseCoefMixin, BaseEstimator):
r"""Sparse Logistic regression estimator.
Expand Down Expand Up @@ -1380,6 +1400,11 @@ def fit(self, X, y):

return self

def __sklearn_tags__(self):
tags = super().__sklearn_tags__()
tags.input_tags.sparse = True
return tags


class MultiTaskLasso(RegressorMixin, LinearModel):
r"""MultiTaskLasso estimator.
Expand Down