예제 #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)
예제 #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)
예제 #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)
예제 #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
예제 #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)
예제 #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)
예제 #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
예제 #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)
예제 #12
0
 def test_labels_count_Error_Empty(self):
     with self.assertRaises(PVE):
         result = voting.labels_count([], 3)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #18
0
 def test_error2(self):
     annot2 = []
     with self.assertRaises(PyannoValueError):
         voting.labels_count(annot2, 3)
예제 #19
0
 def test_raise_error_empty(self):
     with self.assertRaises(voting.PyannoValueError):
         voting.labels_count([], 2)
예제 #20
0
 def test_labels_count_Error_Empty(self):
     with self.assertRaises(PVE):
         result = voting.labels_count([], 3)
예제 #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)
예제 #22
0
 def test_raise_error_empty(self):
     with self.assertRaises(voting.PyannoValueError):
         voting.labels_count([], 2)
예제 #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)
예제 #24
0
 def test_label_count_exception_emptyan(self):
     with self.assertRaises(voting.PyannoValueError):
         annotations = []
         nclasses = 4
         voting.labels_count(annotations, nclasses)
예제 #25
0
 def test_error2(self):
     annot2 = []
     with self.assertRaises(PyannoValueError):
         voting.labels_count(annot2, 3)
예제 #26
0
 def test_raise_error_empty(self):
     mv = -10
     with self.assertRaises(voting.PyannoValueError):
         voting.labels_count([mv, mv], 2, missing_value=mv)
예제 #27
0
 def test_error1(self):
     annot1 = [[MV, MV], [MV, MV]]
     with self.assertRaises(PyannoValueError):
         voting.labels_count(annot1, 3)
예제 #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)
예제 #29
0
    def test_label_count_exception_emptyan(self):
	with self.assertRaises(voting.PyannoValueError):
 	    annotations = []
	    nclasses = 4
	    voting.labels_count(annotations, nclasses)
예제 #30
0
 def test_raise_error_empty(self):
     mv = -10
     with self.assertRaises(voting.PyannoValueError):
         voting.labels_count([mv, mv], 2, missing_value=mv)
예제 #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)
예제 #32
0
 def test_error1(self):
     annot1 = [[MV, MV], [MV, MV]]
     with self.assertRaises(PyannoValueError):
         voting.labels_count(annot1, 3)