source: orange/Orange/doc/modules/discretization.py @ 9671:a7b056375472

Revision 9671:a7b056375472, 667 bytes checked in by anze <anze.staric@…>, 2 years ago (diff)

Moved orange to Orange (part 2)

Line 
1# Description: Demonstrates the use of discretization
2# Category:    discretization
3# Classes:     entropyDiscretization, DiscretizedLearner
4# Uses:        iris.tab
5
6import orange
7import orngDisc
8
9data = orange.ExampleTable("iris.tab")
10
11disc_data = orngDisc.entropyDiscretization(data)
12
13disc_learner = orngDisc.DiscretizedLearner(orange.BayesLearner(), name="disc-bayes")
14learner = orange.BayesLearner(name="bayes")
15
16learners = [learner, disc_learner]
17
18import orngTest, orngStat
19
20results = orngTest.crossValidation(learners, data)
21print "Classification Accuracy:"
22for i in range(len(learners)):
23    print ("%15s: %5.3f") % (learners[i].name, orngStat.CA(results)[i])
Note: See TracBrowser for help on using the repository browser.