Ignore:
Timestamp:
01/06/13 00:27:59 (16 months ago)
Author:
blaz <blaz.zupan@…>
Branch:
default
Message:

new tutorial

File:
1 edited

Legend:

Unmodified
Added
Removed
  • docs/tutorial/rst/code/bagging_test.py

    r9742 r11051  
    55# Classes:     orngTest.crossValidation 
    66 
    7 import orange, orngTree, orngStat, orngTest, orngStat, bagging 
    8 data = orange.ExampleTable("adult_sample.tab") 
     7import bagging 
     8import Orange 
     9data = Orange.data.Table("adult_sample.tab") 
    910 
    10 tree = orngTree.TreeLearner(mForPrunning=10, minExamples=30) 
     11tree = Orange.classification.tree.TreeLearner(mForPrunning=10, minExamples=30) 
    1112tree.name = "tree" 
    1213baggedTree = bagging.Learner(learner=tree, t=5) 
     
    1415learners = [tree, baggedTree] 
    1516 
    16 results = orngTest.crossValidation(learners, data, folds=5) 
     17results = Orange.evaluation.testing.cross_validation(learners, data, folds=5) 
    1718for i in range(len(learners)): 
    18     print "%s: %5.3f" % (learners[i].name, orngStat.CA(results)[i]) 
     19    print "%s: %5.3f" % (learners[i].name, Orange.evaluation.scoring.CA(results)[i]) 
Note: See TracChangeset for help on using the changeset viewer.