source: orange/orange/doc/ofb/bagging_test.py @ 6538:a5f65d7f0b2c

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

Made XPM version of the icon 32x32.

Line 
1# Description: Test for bagging as defined in bagging.py
2# Category:    modelling
3# Uses:        adult_sample.tab, bagging.py
4# Referenced:  c_bagging.htm
5# Classes:     orngTest.crossValidation
6
7import orange, orngTree, orngStat, orngTest, orngStat, bagging
8data = orange.ExampleTable("../datasets/adult_sample")
9
10tree = orngTree.TreeLearner(mForPrunning=10, minExamples=30)
11tree.name = "tree"
12baggedTree = bagging.Learner(learner=tree, t=5)
13
14learners = [tree, baggedTree]
15
16results = orngTest.crossValidation(learners, data, folds=5)
17for i in range(len(learners)):
18    print "%s: %5.3f" % (learners[i].name, orngStat.CA(results)[i])
Note: See TracBrowser for help on using the repository browser.