source: orange/testing/unittests/tests/test_distance.py @ 8136:718bda796fa3

Revision 8136:718bda796fa3, 1.4 KB checked in by ales_erjavec <ales.erjavec@…>, 3 years ago (diff)

Added tests for distance measures, io, knn, rules, table and variable.
Fixed some other tests.

Line 
1import unittest
2from Orange.misc import testing
3from Orange.misc.testing import datasets_driven, test_on_data
4
5from Orange.distance import instances
6
7@datasets_driven
8class TestEuclideanDistance(testing.DistanceTestCase):
9    DISTANCE_CONSTRUCTOR = instances.EuclideanConstructor()
10
11@datasets_driven   
12class TestMannhatanDistance(testing.DistanceTestCase):
13    DISTANCE_CONSTRUCTOR = instances.ManhattanConstructor()
14   
15@datasets_driven
16class TestHammingDistance(testing.DistanceTestCase):
17    DISTANCE_CONSTRUCTOR = instances.HammingConstructor()
18   
19@datasets_driven
20class TestReliefDistance(testing.DistanceTestCase):
21    DISTANCE_CONSTRUCTOR = instances.ReliefConstructor()
22
23@datasets_driven
24class TestPearsonRDistance(testing.DistanceTestCase):
25    DISTANCE_CONSTRUCTOR = instances.PearsonRConstructor()
26
27@datasets_driven
28class TestSpearmanRDistance(testing.DistanceTestCase):
29    DISTANCE_CONSTRUCTOR = instances.SpearmanRConstructor()
30   
31@datasets_driven
32class TestPearsonRAbsoluteDistance(testing.DistanceTestCase):
33    DISTANCE_CONSTRUCTOR = instances.PearsonRAbsoluteConstructor()
34   
35@datasets_driven
36class TestSpearmanRAbsoluteDistance(testing.DistanceTestCase):
37    DISTANCE_CONSTRUCTOR = instances.SpearmanRAbsoluteConstructor()
38   
39@datasets_driven
40class TestMahalanobisDistance(testing.DistanceTestCase):
41    DISTANCE_CONSTRUCTOR = instances.MahalanobisConstructor()
42   
43if __name__ == "__main__":
44    unittest.main()
Note: See TracBrowser for help on using the repository browser.