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/fss7.py

    r9787 r11051  
    1212# Referenced:  o_fss.htm 
    1313 
    14 import orange, orngDisc, orngTest, orngStat, orngFSS 
     14import orngFSS 
     15import Orange 
    1516 
    16 data = orange.ExampleTable("crx.tab") 
     17data = Orange.data.Table("crx.tab") 
    1718 
    18 bayes = orange.BayesLearner() 
    19 dBayes = orngDisc.DiscretizedLearner(bayes, name='disc bayes') 
    20 fss = orngFSS.FilterAttsAboveThresh(threshold=0.05) 
    21 fBayes = orngFSS.FilteredLearner(dBayes, filter=fss, name='bayes & fss') 
     19bayes = Orange.classification.bayes.NaiveLearner() 
     20dBayes = Orange.feature.discretization.DiscretizedLearner(bayes, name='disc bayes') 
     21fss = Orange.feature.selection.FilterAboveThreshold(threshold=0.05) 
     22fBayes = Orange.feature.selection.FilteredLearner(dBayes, filter=fss, name='bayes & fss') 
    2223 
    2324learners = [dBayes, fBayes] 
    24 results = orngTest.crossValidation(learners, data, folds=10, storeClassifiers=1) 
     25results = Orange.evaluation.testing.cross_validation(learners, data, folds=10, storeClassifiers=1) 
    2526 
    2627# how many attributes did each classifier use? 
     
    3536print "\nLearner         Accuracy  #Atts" 
    3637for i in range(len(learners)): 
    37   print "%-15s %5.3f     %5.2f" % (learners[i].name, orngStat.CA(results)[i], natt[i]) 
     38  print "%-15s %5.3f     %5.2f" % (learners[i].name, Orange.evaluation.scoring.CA(results)[i], natt[i]) 
    3839 
    3940# which attributes were used in filtered case? 
Note: See TracChangeset for help on using the changeset viewer.