source: orange/Orange/testing/unit/tests/test_measures.py @ 9679:3879dea56188

Revision 9679:3879dea56188, 1.9 KB checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Moved and renamed testing.

Line 
1from Orange.misc import testing
2from Orange.misc.testing import datasets_driven, test_on_data
3from Orange.feature import scoring
4import unittest   
5   
6
7@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS,
8                 preprocess=testing.DISCRETIZE_DOMAIN)
9class TestMeasureAttr_GainRatio(testing.MeasureAttributeTestCase):
10    MEASURE = scoring.GainRatio()
11   
12   
13@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS,
14                 preprocess=testing.DISCRETIZE_DOMAIN)
15class TestMeasureAttr_InfoGain(testing.MeasureAttributeTestCase):
16    MEASURE = scoring.InfoGain()
17   
18
19# TODO: Relevance, Cost
20
21@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS,
22                 preprocess=testing.DISCRETIZE_DOMAIN)
23class TestMeasureAttr_Distance(testing.MeasureAttributeTestCase):
24    MEASURE = scoring.Distance()
25
26   
27@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS,
28                 preprocess=testing.DISCRETIZE_DOMAIN)
29class TestMeasureAttr_MDL(testing.MeasureAttributeTestCase):
30    MEASURE = scoring.MDL()
31
32
33@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS +\
34                 testing.REGRESSION_DATASETS)
35class TestMeasureAttr_Relief(testing.MeasureAttributeTestCase):
36    MEASURE = scoring.Relief()
37
38
39@datasets_driven(datasets=testing.REGRESSION_DATASETS,
40                 preprocess=testing.DISCRETIZE_DOMAIN)
41class TestMeasureAttr_MSE(testing.MeasureAttributeTestCase):
42    MEASURE = scoring.MSE()
43   
44
45@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS)
46class TestScoringUtils(testing.DataTestCase):
47    @test_on_data
48    def test_order_attrs(self, dataset):
49        order = scoring.OrderAttributes(scoring.Relief())
50        orderes_attrs = order(dataset, 0)
51       
52    @test_on_data
53    def test_score_all(self, dataset):
54        scoring.score_all(dataset, measure=scoring.Relief())
55         
56       
57if __name__ == "__main__":
58    unittest.main()
Note: See TracBrowser for help on using the repository browser.