Skip to content

Commit 18f5d90

Browse files
authored
Scikit-learn 1.7 fixes (#257)
1 parent 1ae3c0b commit 18f5d90

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

examples/regression/Ridge2FoldCVRegularization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,12 @@ def get_train_test_error(estimator):
203203
RidgeCV(
204204
alphas=alphas,
205205
cv=None,
206-
store_cv_values=True,
206+
store_cv_results=True,
207207
scoring=None, # uses by default mean squared error
208208
fit_intercept=False,
209209
)
210210
.fit(X_train, y_train)
211-
.cv_values_
211+
.cv_results_
212212
)
213213

214214
results["sklearn LOO CV Tikhonov"]["MSE validation"] = np.mean(

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ classifiers = [
3838
"Topic :: Scientific/Engineering",
3939
]
4040
dependencies = [
41-
"scikit-learn >= 1.6, < 1.7",
41+
"scikit-learn >= 1.7, < 1.8",
4242
"scipy >= 1.15", # explicit to adhere to scikit-learn dependencies
4343
]
4444
dynamic = ["version"]

src/skmatter/linear_model/_ridge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def _2fold_loss_tikhonov(alpha):
303303
return ((Vt.T[:, :n_alpha] / s[:n_alpha]) @ (U.T[:n_alpha] @ y)).T
304304

305305

306-
class _IdentityRegressor:
306+
class _IdentityRegressor(BaseEstimator):
307307
"""Fake regressor which will directly output the prediction."""
308308

309309
def predict(self, y_predict):

src/skmatter/sample_selection/_base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from scipy.interpolate import LinearNDInterpolator, interp1d
77
from scipy.interpolate._interpnd import _ndim_coords_from_arrays
88
from scipy.spatial import ConvexHull
9+
from sklearn.base import BaseEstimator
910
from sklearn.utils.validation import check_array, check_is_fitted, check_X_y
1011

1112
from .._selection import _CUR, _FPS, _PCovCUR, _PCovFPS
@@ -479,7 +480,7 @@ def _directional_distance(equations, points):
479480
return -orthogonal_distances / equations[:, :1].T
480481

481482

482-
class DirectionalConvexHull:
483+
class DirectionalConvexHull(BaseEstimator):
483484
"""
484485
Performs Sample Selection by constructing a Directional Convex Hull and determining
485486
the distance to the hull as outlined in the reference [dch]_.

0 commit comments

Comments
 (0)