|
26 | 26 | from sklearn.metrics.classification import (_check_targets, _prf_divide,
|
27 | 27 | precision_recall_fscore_support)
|
28 | 28 | from sklearn.preprocessing import LabelEncoder
|
29 |
| -from sklearn.utils.fixes import bincount |
30 | 29 | from sklearn.utils.multiclass import unique_labels
|
31 | 30 |
|
32 | 31 | try:
|
@@ -203,16 +202,16 @@ def sensitivity_specificity_support(y_true,
|
203 | 202 | tp_bins_weights = None
|
204 | 203 |
|
205 | 204 | if len(tp_bins):
|
206 |
| - tp_sum = bincount( |
| 205 | + tp_sum = np.bincount( |
207 | 206 | tp_bins, weights=tp_bins_weights, minlength=len(labels))
|
208 | 207 | else:
|
209 | 208 | # Pathological case
|
210 | 209 | true_sum = pred_sum = tp_sum = np.zeros(len(labels))
|
211 | 210 | if len(y_pred):
|
212 |
| - pred_sum = bincount( |
| 211 | + pred_sum = np.bincount( |
213 | 212 | y_pred, weights=sample_weight, minlength=len(labels))
|
214 | 213 | if len(y_true):
|
215 |
| - true_sum = bincount( |
| 214 | + true_sum = np.bincount( |
216 | 215 | y_true, weights=sample_weight, minlength=len(labels))
|
217 | 216 |
|
218 | 217 | # Compute the true negative
|
@@ -611,14 +610,14 @@ class is unrecognized by the classifier, G-mean resolves to zero. To
|
611 | 610 | tp_bins_weights = None
|
612 | 611 |
|
613 | 612 | if len(tp_bins):
|
614 |
| - tp_sum = bincount(tp_bins, weights=tp_bins_weights, |
615 |
| - minlength=len(labels)) |
| 613 | + tp_sum = np.bincount(tp_bins, weights=tp_bins_weights, |
| 614 | + minlength=len(labels)) |
616 | 615 | else:
|
617 | 616 | # Pathological case
|
618 | 617 | true_sum = tp_sum = np.zeros(len(labels))
|
619 | 618 | if len(y_true):
|
620 |
| - true_sum = bincount(y_true, weights=sample_weight, |
621 |
| - minlength=len(labels)) |
| 619 | + true_sum = np.bincount(y_true, weights=sample_weight, |
| 620 | + minlength=len(labels)) |
622 | 621 |
|
623 | 622 | # Retain only selected labels
|
624 | 623 | indices = np.searchsorted(sorted_labels, labels[:n_labels])
|
|
0 commit comments