Esempio n. 1
0
 def test_eval_01(self):
     # --npp 1.0 --npa 1.0 --nap 2.0 --naa 2.0 --kappa_simpletest 0.5
     output = kappa_simple.calculate_kappa(1.0, 1.0, 2.0, 2.0, 0.5)
     self.must_contain(output, 'present   | 1         | 1')
     self.must_contain(output, 'absent    | 2         | 2')
     self.must_contain(output, '= 0.3849')
     self.must_contain(output, 'kappa= 0.5] = 0.9030')
Esempio n. 2
0
 def test_eval_02(self):
     # --npp 0.0 --npa 0.1 --nap 1.0 --naa 0.0 --kappa_simpletest 0.5
     output = kappa_simple.calculate_kappa(0.0, 0.1, 1.0, 0.0, 0.5)
     self.must_contain(output, 'present   | 0         | 0')
     self.must_contain(output, 'absent    | 1         | 0')
     self.must_contain(output, 'estimated kappa = -0.198')
     self.must_contain(output, '= 0.6437')
     self.must_contain(output, 'kappa= 0.5] = 0.8608')
Esempio n. 3
0
 def test_kappa_validate_input_09(self):
     output = kappa_simple.calculate_kappa(1.0, 0.0, 0.0, 1.0, 0.5)
     self.must_contain(
         output,
         'Perfect agreement (some rating pairs are "present", all others are "absent")'
     )
Esempio n. 4
0
 def test_kappa_validate_input_08(self):
     output = kappa_simple.calculate_kappa(0.0, 0.0, 1.0, 1.0, 0.5)
     self.must_contain(
         output,
         'Rater A has marked all tests as "absent"; rater B has "present" and "absent"'
     )
Esempio n. 5
0
 def test_kappa_validate_input_04(self):
     output = kappa_simple.calculate_kappa(0.0, 0.0, 0.0, 1.0, 0.5)
     self.must_contain(output,
                       'Perfect agreement (all rating pairs are "absent")')
Esempio n. 6
0
 def test_kappa_less_than_zero(self):
     output = kappa_simple.calculate_kappa(1.0, 1.0, 2.0, 2.0, -1)
     self.must_contain(
         output,
         'Kappatest must be greater than or equal to zero and less than 1')
Esempio n. 7
0
 def test_eval_03(self):
     # --npp 0.0 --npa 1.0 --nap 1.0 --naa 0.0 --kappa_simpletest 0.5
     with self.assertRaises(ZeroDivisionError):
         kappa_simple.calculate_kappa(0.0, 1.0, 1.0, 0.0, 0.5)