Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d954846

Browse files
committed
Merge pull request scikit-learn#2952 from jnothman/future_warn_two_labels
MAINT warn of future behaviour change proposed in scikit-learn#2610
2 parents b08d193 + 28c8d0b commit d954846

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sklearn/metrics/metrics.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,6 +1622,13 @@ def precision_recall_fscore_support(y_true, y_pred, beta=1.0, labels=None,
16221622
### Select labels to keep ###
16231623

16241624
if y_type == 'binary' and average is not None and pos_label is not None:
1625+
if label_order is not None and len(label_order) == 2:
1626+
warnings.warn('In the future, providing two `labels` values, as '
1627+
'well as `average` will average over those '
1628+
'labels. For now, please use `labels=None` with '
1629+
'`pos_label` to evaluate precision, recall and '
1630+
'F-score for the positive label only.',
1631+
FutureWarning)
16251632
if pos_label not in labels:
16261633
if len(labels) == 1:
16271634
# Only negative labels

0 commit comments

Comments
 (0)