Skip to content

Commit 61994d9

Browse files
committed
force floating input for xp.mean
1 parent 7db72a4 commit 61994d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sklearn/metrics/cluster/_unsupervised.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ def calinski_harabasz_score(X, labels):
368368
"""
369369

370370
xp, _, device_ = get_namespace_and_device(X, labels)
371-
X = xp.astype(X, _max_precision_float_dtype(xp, device_), copy=False)
371+
X = xp.asarray(X, dtype=_max_precision_float_dtype(xp, device_), device=device_)
372372
X, labels = check_X_y(X, labels)
373373
le = LabelEncoder()
374374
labels = le.fit_transform(labels)

0 commit comments

Comments
 (0)