Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TST Add some tests parametrization for test_neighbors #22281

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

Merged
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
1 change: 1 addition & 0 deletions sklearn/metrics/tests/test_dist_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def dist_func(x1, x2, p):
VI = np.dot(V, V.T)

BOOL_METRICS = [
"hamming",
"matching",
"jaccard",
"dice",
Expand Down
8 changes: 6 additions & 2 deletions sklearn/neighbors/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from ..utils.multiclass import check_classification_targets
from ..utils.validation import check_is_fitted
from ..utils.validation import check_non_negative
from ..utils.fixes import delayed
from ..utils.fixes import delayed, sp_version
from ..utils.fixes import parse_version
from ..exceptions import DataConversionWarning, EfficiencyWarning

Expand Down Expand Up @@ -63,11 +63,15 @@
"sokalsneath",
"sqeuclidean",
"yule",
"wminkowski",
]
),
)

# TODO: Remove filterwarnings in 1.3 when wminkowski is removed
if sp_version < parse_version("1.8.0.dev0"):
# Before scipy 1.8.0.dev0, wminkowski was the key to use
# the weighted minkowski metric.
VALID_METRICS["brute"].append("wminkowski")

VALID_METRICS_SPARSE = dict(
ball_tree=[],
Expand Down
Loading