Exemple #1
0
 def test_binarize_labels_multiclass(self):
     md = pd.Series([c for c in 'abcabc'])
     labels = _binarize_labels(md, ['a', 'b', 'c'])
     exp = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1],
                     [1, 0, 0], [0, 1, 0], [0, 0, 1]])
     np.testing.assert_array_equal(exp, labels)
Exemple #2
0
 def test_binarize_labels_binary(self):
     md = pd.Series([c for c in 'aabbaa'])
     labels = _binarize_labels(md, ['a', 'b'])
     exp = np.array([[1, 0], [1, 0], [0, 1], [0, 1], [1, 0], [1, 0]])
     np.testing.assert_array_equal(exp, labels)