source: orange/orange/doc/modules/ensemble.py @ 6538:a5f65d7f0b2c

Revision 6538:a5f65d7f0b2c, 746 bytes checked in by Mitar <Mitar@…>, 4 years ago (diff)

Made XPM version of the icon 32x32.

Line 
1# Description: Demonstrates the use of boosting and bagging from orngEnsemble module
2# Category:    classification, ensembles
3# Classes:     BoostedLearner, BaggedLearner
4# Uses:        lymphography.tab
5# Referenced:  orngEnsemble.htm
6
7import orange, orngEnsemble, orngTree
8import orngTest, orngStat
9
10tree = orngTree.TreeLearner(mForPruning=2, name="tree")
11bs = orngEnsemble.BoostedLearner(tree, name="boosted tree")
12bg = orngEnsemble.BaggedLearner(tree, name="bagged tree")
13
14data = orange.ExampleTable("lymphography.tab")
15
16learners = [tree, bs, bg]
17results = orngTest.crossValidation(learners, data, folds=3)
18print "Classification Accuracy:"
19for i in range(len(learners)):
20    print ("%15s: %5.3f") % (learners[i].name, orngStat.CA(results)[i])
Note: See TracBrowser for help on using the repository browser.