source: orange/testing/unittests/tests/test_bayes.py @ 8735:065a34c267f2

Revision 8735:065a34c267f2, 737 bytes checked in by matejd <matejd@…>, 3 years ago (diff)

Moved over code from qtgraph branch, turned primitives into a module (plot.primitives); added Visualize Qt folder to setup.py packages

Line 
1from Orange.misc import testing
2
3# TODO: test different prob estimators
4@testing.datasets_driven(datasets=testing.CLASSIFICATION_DATASETS)
5class TestNaiveBayes(testing.LearnerTestCase):   
6    def setUp(self):
7        import orngBayes
8        self.learner = orngBayes.BayesLearner()
9       
10    @testing.test_on_data
11    def test_learner_on(self, dataset):
12        testing.LearnerTestCase.test_learner_on(self, dataset)
13       
14        # test __str__ method
15        print_str = str(self.classifier)
16       
17        # test p method
18        if dataset.domain.classVar:
19            for ex in dataset:
20                for cls in dataset.domain.classVar.values:
21                    p = self.classifier.p(cls, ex)
22                   
23   
Note: See TracBrowser for help on using the repository browser.