Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sklearn>=0.24.0, and drop older ones (closes #92) #98

Merged
merged 8 commits into from
Mar 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
change to 0.24.0
  • Loading branch information
kazuki1004 committed Dec 25, 2020
commit b3cbe2d14be799d8310fdf2fc488b59414fd7319
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
numpy
scipy
scikit-learn>=0.19.0
scikit-learn>=0.24.0
joblib
4 changes: 2 additions & 2 deletions spmimage/decomposition/ksvd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
from sklearn.base import BaseEstimator
from sklearn.decomposition.dict_learning import SparseCodingMixin, sparse_encode
from sklearn.decomposition._dict_learning import _BaseSparseCoding, sparse_encode
from sklearn.utils import check_array
from sklearn.utils.validation import check_is_fitted

Expand Down Expand Up @@ -116,7 +116,7 @@ def _ksvd(Y: np.ndarray, n_components: int, n_nonzero_coefs: int, max_iter: int,
return W, H, errors, k + 1


class KSVD(BaseEstimator, SparseCodingMixin):
class KSVD(BaseEstimator, _BaseSparseCoding):
""" K-SVD
Finds a dictionary that can be used to represent data using a sparse code.
Solves the optimization problem:
Expand Down
4 changes: 2 additions & 2 deletions spmimage/linear_model/admm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from sklearn.utils import check_array, check_X_y
from sklearn.base import RegressorMixin
from sklearn.linear_model.base import LinearModel
from sklearn.linear_model.coordinate_descent import _alpha_grid
from sklearn.linear_model._base import LinearModel
from sklearn.linear_model._coordinate_descent import _alpha_grid
from joblib import Parallel, delayed

logger = getLogger(__name__)
Expand Down