scikit-learn/scikit-learn — pull request #3670 by nathanathan (2014-09-17 13:25:31+00:00)
Title: Altering precision_recall_fscore_support docstring

If the labels are unsorted and precision_recall_fscore_support is used with multilabel classifications it will raise an exception. E.g.:
```
sklearn.metrics.precision_recall_fscore_support(
[(1,2)],
[(3,4)],
labels=[4, 1, 2, 3]
)
```
raises
```
/usr/local/lib/python2.7/dist-packages/sklearn/metrics/classification.pyc in precision_recall_fscore_support(y_true, y_pred, beta, labels, pos_label, average, warn_for, sample_weight)
945 elif label_order is not None:
946 indices = np.searchsorted(labels, label_order)
--> 947 precision = precision[indices]
948 recall = recall[indices]
949 f_score = f_score[indices]

IndexError: index 4 is out of bounds for size 4
```
Also, AFAICT the labels do not need to be integers.