Esempio n. 1
0
 def test_labels_count_no_valid_observations(self):
     annotations = [
         [MV, MV],
         [MV, MV],
     ]
     with self.assertRaises(voting.PyannoValueError):
          voting.labels_count([], 3)
     with self.assertRaises(voting.PyannoValueError):
          voting.labels_count(annotations, 3)
Esempio n. 2
0
 def test_labels_count_no_valid_observations(self):
     annotations = [
         [MV, MV],
         [MV, MV],
     ]
     with self.assertRaises(voting.PyannoValueError):
         voting.labels_count([], 3)
     with self.assertRaises(voting.PyannoValueError):
         voting.labels_count(annotations, 3)
Esempio n. 3
0
 def test_labels_count(self):
     annotations = [
         [1, 2, MV, MV],
         [MV, MV, 3, 3],
         [MV, 1, 3, 1],
         [MV, MV, MV, MV],
     ]
     nclasses = 5
     expected = [0, 3, 1, 3, 0]
     result = voting.labels_count(annotations, nclasses)
     self.assertEqual(result, expected)
Esempio n. 4
0
 def test_labels_count(self):
     annotations = [
         [1,  2, MV, MV],
         [MV, MV,  3,  3],
         [MV,  1,  3,  1],
         [MV, MV, MV, MV],
     ]
     nclasses = 5
     expected = [0, 3, 1, 3, 0]
     result = voting.labels_count(annotations, nclasses)
     self.assertEqual(result, expected)
def test_labels_count():
    annotations = [
        [1,  2, MV, MV],
        [MV, MV,  3,  3],
        [MV,  1,  3,  1],
        [MV, MV, MV, MV],
    ]
    nclasses = 5
    expected = [0, 3, 1, 3, 0]
    result = voting.labels_count(annotations, nclasses)
    assert result == expected
def test_labels_count():
    annotations = [
        [1, 2, MV, MV],
        [MV, MV, 3, 3],
        [MV, 1, 3, 1],
        [MV, MV, MV, MV],
    ]
    nclasses = 5
    expected = [0, 3, 1, 3, 0]
    result = voting.labels_count(annotations, nclasses)
    assert result == expected
Esempio n. 7
0
 def test_labels_count_newmissingvalue(self):
     m = -99
     annotations = [
         [1, 2, m, m],
         [m, m, 3, 3],
         [m, 1, 3, 1],
         [m, m, m, m],
     ]
     nclasses = 5
     expected = [0, 3, 1, 3, 0]
     result = voting.labels_count(annotations, nclasses, m)
     self.assertEqual(result, expected)
Esempio n. 8
0
    def test_labels_count_newmv(self):
	mv = -999
        annotations = [
            [1,  2, mv, mv],
            [mv, mv,  3,  3],
            [mv,  1,  3,  1],
            [mv, mv, mv, mv],
        ]
        nclasses = 5
        expected = [0, 3, 1, 3, 0]
        result = voting.labels_count(annotations, nclasses, missing_value=mv)
        self.assertEqual(result, expected)
Esempio n. 9
0
 def test_labels_count_newmissingvalue(self):
     m = -99
     annotations = [
         [1,  2, m, m],
         [m, m,  3,  3],
         [m,  1,  3,  1],
         [m, m, m, m],
     ]
     nclasses = 5
     expected = [0, 3, 1, 3, 0]
     result = voting.labels_count(annotations, nclasses, m)
     self.assertEqual(result, expected)
def test_labels_count_non_default_missing_values():
    mv = -999
    annotations = [
        [ 1,  2, mv, mv],
        [mv, mv,  3,  3],
        [mv,  1,  3,  1],
        [mv, mv, mv, mv],
    ]
    nclasses = 5
    expected = [0, 3, 1, 3, 0]
    result = voting.labels_count(annotations, nclasses, missing_value=mv)
    assert result == expected
Esempio n. 11
0
 def test_labels_count_non_default_missing_values(self):
     mv = -999
     annotations = [
         [1, 2, mv, mv],
         [mv, mv, 3, 3],
         [mv, 1, 3, 1],
         [mv, mv, mv, mv],
     ]
     nclasses = 5
     expected = [0, 3, 1, 3, 0]
     result = voting.labels_count(annotations, nclasses, missing_value=mv)
     self.assertEqual(result, expected)
Esempio n. 12
0
 def test_labels_count_Error_Empty(self):
     with self.assertRaises(PVE):
         result = voting.labels_count([], 3)
Esempio n. 13
0
 def test_labels_count_Error_MV(self):
     with self.assertRaises(PVE):
         annotations = np.array([[MV,MV,MV]])
         result = voting.labels_count(annotations, 3)
Esempio n. 14
0
    def test_missing_observations(self):
        annotations = np.array([[MV, MV, MV], [MV, MV, MV]])

        with self.assertRaises(voting.PyannoValueError):
            voting.labels_count(annotations, 4, MV)
Esempio n. 15
0
    def test_missing_observations(self):
        annotations = np.array([[MV, MV, MV], [MV, MV, MV]])

        with self.assertRaises(voting.PyannoValueError):
            voting.labels_count(annotations, 4, MV)
Esempio n. 16
0
 def test_label_count_exception_allmissing(self):
     with self.assertRaises(voting.PyannoValueError):
         annotations = np.zeros((2, 3)) + MV
         nclasses = 4
         voting.labels_count(annotations, nclasses)
Esempio n. 17
0
    def test_label_count_exception_allmissing(self):
	with self.assertRaises(voting.PyannoValueError):
            annotations = np.zeros((2,3)) + MV
            nclasses = 4
            voting.labels_count(annotations, nclasses)
Esempio n. 18
0
 def test_error2(self):
     annot2 = []
     with self.assertRaises(PyannoValueError):
         voting.labels_count(annot2, 3)
Esempio n. 19
0
 def test_raise_error_empty(self):
     with self.assertRaises(voting.PyannoValueError):
         voting.labels_count([], 2)
Esempio n. 20
0
 def test_labels_count_Error_Empty(self):
     with self.assertRaises(PVE):
         result = voting.labels_count([], 3)
Esempio n. 21
0
 def test_labels_count_Error_MV(self):
     with self.assertRaises(PVE):
         annotations = np.array([[MV, MV, MV]])
         result = voting.labels_count(annotations, 3)
Esempio n. 22
0
 def test_raise_error_empty(self):
     with self.assertRaises(voting.PyannoValueError):
         voting.labels_count([], 2)
Esempio n. 23
0
 def test_valueError(self):
     with self.assertRaises(PyannoValueError):
         voting.labels_count([], 4)
     with self.assertRaises(PyannoValueError):
         voting.labels_count([MV, MV, MV, MV], 4)
Esempio n. 24
0
 def test_label_count_exception_emptyan(self):
     with self.assertRaises(voting.PyannoValueError):
         annotations = []
         nclasses = 4
         voting.labels_count(annotations, nclasses)
Esempio n. 25
0
 def test_error2(self):
     annot2 = []
     with self.assertRaises(PyannoValueError):
         voting.labels_count(annot2, 3)
Esempio n. 26
0
 def test_raise_error_empty(self):
     mv = -10
     with self.assertRaises(voting.PyannoValueError):
         voting.labels_count([mv, mv], 2, missing_value=mv)
Esempio n. 27
0
 def test_error1(self):
     annot1 = [[MV, MV], [MV, MV]]
     with self.assertRaises(PyannoValueError):
         voting.labels_count(annot1, 3)
Esempio n. 28
0
 def test_optional_missing_value_labels_count(self):
     mv = -99
     result = voting.labels_count([[1, 1, 2], [mv, 1, 2]], 4, mv)
     expected = np.asarray([0., 3, 2, 0.])
     assert_array_almost_equal(result, expected)
Esempio n. 29
0
    def test_label_count_exception_emptyan(self):
	with self.assertRaises(voting.PyannoValueError):
 	    annotations = []
	    nclasses = 4
	    voting.labels_count(annotations, nclasses)
Esempio n. 30
0
 def test_raise_error_empty(self):
     mv = -10
     with self.assertRaises(voting.PyannoValueError):
         voting.labels_count([mv, mv], 2, missing_value=mv)
Esempio n. 31
0
 def test_optional_missing_value_labels_count(self):
     mv = -99
     result = voting.labels_count([[1, 1, 2], [mv, 1, 2]], 4, mv)
     expected = np.asarray([ 0. ,  3,  2,  0. ])
     assert_array_almost_equal(result, expected)
Esempio n. 32
0
 def test_error1(self):
     annot1 = [[MV, MV], [MV, MV]]
     with self.assertRaises(PyannoValueError):
         voting.labels_count(annot1, 3)