Passed
Push — master ( 170db5...8af2aa )
by Shlomi
02:43 queued 58s
created

ethically.fairness.metrics.utils   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 3

1 Function

Rating   Name   Duplication   Size   Complexity  
A _assert_binary() 0 9 3
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