source: orange/Orange/testing/regression/tests_20/modules_discretization.py @ 9952:986e9cd806f4

Revision 9952:986e9cd806f4, 667 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Tests moved and renamed from orange 20.

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.