We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7b48a67 + 13b6071 commit efd866fCopy full SHA for efd866f
1 file changed
sklearnex/utils/class_weight.py
@@ -142,6 +142,8 @@ def _compute_class_weight(
142
unweighted_classes = []
143
for i, c in enumerate(classes):
144
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
147
weight[i] = class_weight[fc]
148
else:
149
unweighted_classes.append(c)
0 commit comments