source: orange/docs/reference/rst/code/bayes-thresholdAdjustment.py @ 9638:eb3af38491f2

Revision 9638:eb3af38491f2, 623 bytes checked in by umek@…, 2 years ago (diff)

Changed table to data or name of the data set.

For example - instead of

table = Orange.data.Table("housing")

is changed to

housing = Orange.data.Table("housing")

Line 
1# Description: Naive Bayes Learner with auto adjusted treshold
2# Category:    classification
3# Uses:        iris
4# Referenced:  Orange.classification.bayes
5# Classes:     Orange.classification.bayes.NaiveLearner, Orange.classification.bayes.NaiveClassifier
6
7import Orange
8from Orange.classification import bayes
9from Orange.evaluation import testing, scoring
10
11adult = Orange.data.Table("adult_sample.tab")
12
13nb = bayes.NaiveLearner(name="Naive Bayes")
14adjusted_nb = bayes.NaiveLearner(adjust_threshold=True, name="Adjusted Naive Bayes")
15
16results = testing.cross_validation([nb, adjusted_nb], adult)
17print scoring.CA(results)
Note: See TracBrowser for help on using the repository browser.