Skip to content
Merged
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
4 changes: 2 additions & 2 deletions examples/regression/Ridge2FoldCVRegularization.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,12 @@ def get_train_test_error(estimator):
RidgeCV(
alphas=alphas,
cv=None,
store_cv_values=True,
store_cv_results=True,
scoring=None, # uses by default mean squared error
fit_intercept=False,
)
.fit(X_train, y_train)
.cv_values_
.cv_results_
)

results["sklearn LOO CV Tikhonov"]["MSE validation"] = np.mean(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ classifiers = [
"Topic :: Scientific/Engineering",
]
dependencies = [
"scikit-learn >= 1.6, < 1.7",
"scikit-learn >= 1.7, < 1.8",
"scipy >= 1.15", # explicit to adhere to scikit-learn dependencies
]
dynamic = ["version"]
Expand Down
2 changes: 1 addition & 1 deletion src/skmatter/linear_model/_ridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def _2fold_loss_tikhonov(alpha):
return ((Vt.T[:, :n_alpha] / s[:n_alpha]) @ (U.T[:n_alpha] @ y)).T


class _IdentityRegressor:
class _IdentityRegressor(BaseEstimator):
"""Fake regressor which will directly output the prediction."""

def predict(self, y_predict):
Expand Down
3 changes: 2 additions & 1 deletion src/skmatter/sample_selection/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from scipy.interpolate import LinearNDInterpolator, interp1d
from scipy.interpolate._interpnd import _ndim_coords_from_arrays
from scipy.spatial import ConvexHull
from sklearn.base import BaseEstimator
from sklearn.utils.validation import check_array, check_is_fitted, check_X_y

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


class DirectionalConvexHull:
class DirectionalConvexHull(BaseEstimator):
"""
Performs Sample Selection by constructing a Directional Convex Hull and determining
the distance to the hull as outlined in the reference [dch]_.
Expand Down