8000 Merge branch 'array_API_cosine_distance' of github.com:EmilyXinyi/sci… · scikit-learn/scikit-learn@da921c4 · GitHub
[go: up one dir, main page]

Skip to content

Commit da921c4

Browse files
committed
Merge branch 'array_API_cosine_distance' of github.com:EmilyXinyi/scikit-learn into array_API_cosine_distance
2 parents c733060 + 0e8894d commit da921c4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sklearn/metrics/pairwise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ def cosine_distances(X, Y=None):
11271127
S = cosine_similarity(X, Y)
11281128
S *= -1
11291129
S += 1
1130-
S = _clip(X, S, 0, 2, xp)
1130+
S = _clip(S, 0, 2, xp)
11311131
if X is Y or Y is None:
11321132
# Ensure that distances between vectors and themselves are set to 0.0.
11331133
# This may not be the case due to floating point rounding errors.

sklearn/utils/_array_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ def _nanmax(X, axis=None, xp=None):
752752
return X
753753

754754

755-
def _clip(X, S, min_val, max_val, xp):
755+
def _clip(S, min_val, max_val, xp):
756756
# TODO: remove this method and change all usage once we move to array api 2023.12
757757
# https://data-apis.org/array-api/2023.12/API_specification/generated/array_api.clip.html#clip
758758
if _is_numpy_namespace(xp):

0 commit comments

Comments
 (0)
0