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

[ENH] sklearn 1.2.0 compatibility - remove private _check_weights import in KNeighborsTimeSeriesClassifier and -Regressor #3918

Merged
merged 2 commits into from Dec 19, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -24,7 +24,6 @@

import numpy as np
from sklearn.neighbors import KNeighborsClassifier
from sklearn.neighbors._base import _check_weights

from sktime.classification.base import BaseClassifier
from sktime.datatypes import check_is_mtype
Expand Down Expand Up @@ -139,7 +138,7 @@ def __init__(
n_jobs=None,
):
self.n_neighbors = n_neighbors
self.weights = _check_weights(weights)
self.weights = weights
self.algorithm = algorithm
self.distance = distance
self.distance_params = distance_params
Expand Down
Expand Up @@ -13,7 +13,6 @@
__all__ = ["KNeighborsTimeSeriesRegressor"]

from sklearn.neighbors import KNeighborsRegressor
from sklearn.neighbors._base import _check_weights

from sktime.distances import pairwise_distance
from sktime.regression.base import BaseRegressor
Expand Down Expand Up @@ -132,7 +131,7 @@ def __init__(
leaf_size=leaf_size,
n_jobs=n_jobs,
)
self.weights = _check_weights(weights)
self.weights = weights

super(KNeighborsTimeSeriesRegressor, self).__init__()

Expand Down