| Total Complexity | 3 |
| Total Lines | 13 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from sklearn.metrics.classification import _check_targets |
||
| 2 | |||
| 3 | |||
| 4 | def _assert_binary(y1, y2=None): |
||
| 5 | |||
| 6 | if y2 is None: |
||
| 7 | y2 = y1 |
||
| 8 | |||
| 9 | y_type, _, _ = _check_targets(y1, y2) |
||
| 10 | |||
| 11 | if y_type != 'binary': |
||
| 12 | raise ValueError('y_true and y_pred must be binary.') |
||
| 13 |