Ignore:
Timestamp:
02/06/12 20:01:02 (2 years ago)
Author:
lanumek
Branch:
default
Children:
9835:e48466fc6eb2, 9841:05a160804431
rebase_source:
8cf30121654f25c9cb6d8ac9bdaf163e305d62da
Message:

Changed names of data sets (table replaced with data or name of the data set).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • docs/reference/rst/code/selection-filtered-learner.py

    r9661 r9823  
    88# Classes:     Orange.feature.selection.FilteredLearner 
    99 
    10 import Orange 
    11  
     10import Orange, orngTest, orngStat 
    1211voting = Orange.data.Table("voting") 
    1312 
    1413nb = Orange.classification.bayes.NaiveLearner() 
    15 fl = Orange.feature.selection.FilteredLearner(nb, 
    16      filter=Orange.feature.selection.FilterBestN(n=1), name='filtered') 
     14fl = Orange.feature.selection.FilteredLearner(nb,  
     15     filter=Orange.feature.selection.FilterBestNAtts(n=1), name='filtered') 
    1716learners = (Orange.classification.bayes.NaiveLearner(name='bayes'), fl) 
    18 results = Orange.evaluation.testing.cross_validation(learners, voting, storeClassifiers=1) 
     17results = orngTest.crossValidation(learners, voting, storeClassifiers=1) 
    1918 
    2019# output the results 
    2120print "Learner      CA" 
    2221for i in range(len(learners)): 
    23     print "%-12s %5.3f" % (learners[i].name, Orange.evaluation.scoring.CA(results)[i]) 
     22    print "%-12s %5.3f" % (learners[i].name, orngStat.CA(results)[i]) 
    2423 
    2524# find out which attributes were retained by filtering 
Note: See TracChangeset for help on using the changeset viewer.