Skip to content

Commit efd866f

Browse files
Merge branch 'classif_y_rf' into knn_y
2 parents 7b48a67 + 13b6071 commit efd866f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

sklearnex/utils/class_weight.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ def _compute_class_weight(
142142
unweighted_classes = []
143143
for i, c in enumerate(classes):
144144
if (fc := float(c)) in class_weight:
145+
# array API has only numeric datatypes, convert to float for generality
146+
# complex values should never be observed by this function
145147
weight[i] = class_weight[fc]
146148
else:
147149
unweighted_classes.append(c)

0 commit comments

Comments
 (0)