source: orange/Orange/testing/unit/tests/test_ensemble.py @ 9978:e00980dbb07e

Revision 9978:e00980dbb07e, 1.5 KB checked in by ales_erjavec, 2 years ago (diff)

Disabled pickling test for RandomForest (SmallTreeLearner is not picklable).

Line 
1from Orange.misc import testing
2from Orange.misc.testing import datasets_driven, test_on_datasets
3
4@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS)
5class TestBoosting(testing.LearnerTestCase):   
6    def setUp(self): 
7        import orngEnsemble, orngTree
8        self.learner = orngEnsemble.BoostedLearner(orngTree.TreeLearner)
9       
10    @test_on_datasets(datasets=["iris"])
11    def test_pickling_on(self, dataset):
12        testing.LearnerTestCase.test_pickling_on(self, dataset)
13       
14@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS +\
15                 testing.REGRESSION_DATASETS)
16class TestBagging(testing.LearnerTestCase):
17    def setUp(self): 
18        import orngEnsemble, orngTree
19        self.learner = orngEnsemble.BaggedLearner(orngTree.TreeLearner)
20
21    @test_on_datasets(datasets=["iris"])
22    def test_pickling_on(self, dataset):
23        testing.LearnerTestCase.test_pickling_on(self, dataset)
24
25
26@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS)
27class TestRandomForest(testing.LearnerTestCase):
28    def setUp(self): 
29        import orngEnsemble, orngTree
30        self.learner = orngEnsemble.RandomForestLearner()
31       
32    @test_on_datasets(datasets=["iris"])
33    def test_pickling_on(self, dataset):
34        raise NotImplemented("SmallTreeLearner pickling is not implemented")
35#        testing.LearnerTestCase.test_pickling_on(self, dataset)
36       
37       
38       
39if __name__ == "__main__":
40    import unittest
41    unittest.main()
42               
Note: See TracBrowser for help on using the repository browser.