source: orange/Orange/testing/unit/tests/test_tree.py @ 10655:a228b55811a4

Revision 10655:a228b55811a4, 1.2 KB checked in by markotoplak, 2 years ago (diff)

Moved testing from utils into testing.

Line 
1from Orange.testing import testing
2from Orange.testing.testing import datasets_driven, test_on_data
3try:
4    import unittest2 as unittest
5except:
6    import unittest
7from Orange.classification import tree as ctree
8from Orange.regression import tree as rtree
9from Orange.feature import scoring
10# TODO: test different split_constructors, descenders, measures, stop criteria...
11
12@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS)
13class TestClassification(testing.LearnerTestCase):
14    LEARNER = ctree.TreeLearner(max_depth=50)
15
16
17@datasets_driven(datasets=testing.REGRESSION_DATASETS)
18class TestRegression(testing.LearnerTestCase):
19    LEARNER = rtree.TreeLearner(max_depth=50)
20
21
22@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS)
23class TestSTLClassification(testing.LearnerTestCase):
24    LEARNER = ctree.SimpleTreeLearner(max_depth=50)
25
26
27@datasets_driven(datasets=testing.REGRESSION_DATASETS)
28class TestSTLRegression(testing.LearnerTestCase):
29    LEARNER = rtree.SimpleTreeLearner(max_depth=50)
30
31    def test_learner_on(self):
32        # Does not pass unittests beacuse it returns None for the distribution.
33        # I do not plan on implementing this as it will only add unnecessary overhead.
34        pass
35
36
37if __name__ == "__main__":
38    unittest.main()
Note: See TracBrowser for help on using the repository browser.