Skip to content

Commit 238def1

Browse files
jnothmanogrisel
authored andcommitted
TST fix testing for sequence of sequences warning in metrics
1 parent efede63 commit 238def1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sklearn/metrics/metrics.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,6 @@ def accuracy_score(y_true, y_pred, normalize=True, sample_weight=None):
12831283
2
12841284
12851285
In the multilabel case with binary label indicators:
1286-
12871286
>>> accuracy_score(np.array([[0, 1], [1, 1]]), np.ones((2, 2)))
12881287
0.5
12891288
"""

sklearn/metrics/tests/test_metrics.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1681,8 +1681,9 @@ def test_multilabel_representation_invariance():
16811681
if isinstance(metric, partial):
16821682
metric.__module__ = 'tmp'
16831683
metric.__name__ = name
1684-
metric = ignore_warnings(metric)
1684+
# Check warning for sequence of sequences
16851685
measure = assert_warns(DeprecationWarning, metric, y1, y2)
1686+
metric = ignore_warnings(metric)
16861687

16871688
# Check representation invariance
16881689
assert_almost_equal(metric(y1_binary_indicator,

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