Skip to content

Commit 28546c8

Browse files
mheilmanamueller
authored andcommitted
fixed reverse sorting issue in label_binarize()
1 parent d54b856 commit 28546c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sklearn/preprocessing/label.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ def label_binarize(y, classes, neg_label=0, pos_label=1,
559559

560560
# preserve label ordering
561561
if np.any(classes != sorted_class):
562-
indices = np.argsort(classes)
562+
indices = np.searchsorted(sorted_class, classes)
563563
Y = Y[:, indices]
564564

565565
if y_type == "binary":

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy