source: orange/testing/unittests/tests/test_ensemble.py @ 8939:e2cdffe99aac

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

Fixed errors in clustering and ensemble test cases.

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@datasets_driven(datasets=testing.CLASSIFICATION_DATASETS)
26class TestRandomForest(testing.LearnerTestCase):
27    def setUp(self): 
28        import orngEnsemble, orngTree
29        self.learner = orngEnsemble.RandomForestLearner()
30       
31    @test_on_datasets(datasets=["iris"])
32    def test_pickling_on(self, dataset):
33        testing.LearnerTestCase.test_pickling_on(self, dataset)
34       
35       
36if __name__ == "__main__":
37    import unittest
38    unittest.main()
39               
Note: See TracBrowser for help on using the repository browser.