Changeset 8903:1c943fbbd883 in orange


Ignore:
Timestamp:
09/05/11 11:35:34 (3 years ago)
Author:
mocnik <mocnik@…>
Branch:
default
Convert:
93b9ba93a515f74042891b8f42486683fc09b6bb
Message:

Updating documentation.

Location:
orange
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/evaluation/reliability.py

    r8902 r8903  
    8585=========== 
    8686 
    87 These methods can be referenced using constants inside the module. For setting, 
    88 which methods to use after creating learner, like this:: 
    89  
    90   reliability.use[Orange.evaluation.reliability.DO_SA] = False 
    91   reliability.use[Orange.evaluation.reliability.DO_BAGV] = True 
    92   reliability.use[Orange.evaluation.reliability.DO_CNK] = False 
    93   reliability.use[Orange.evaluation.reliability.DO_LCV] = True 
    94   reliability.use[Orange.evaluation.reliability.DO_BVCK] = False 
    95   reliability.use[Orange.evaluation.reliability.DO_MAHAL] = False 
    96  
    97 There is also a dictionary named :data:`METHOD_NAME` which has stored names of 
     87There is a dictionary named :data:`METHOD_NAME` which has stored names of 
    9888all the reliability estimates:: 
    9989 
     
    153143or because you think they don't perform good enough. 
    154144 
    155 .. literalinclude:: code/reliability-long.py 
    156     :lines: 30-42 
    157  
    158 In this part of the example we have a usual prediction problem, we have a  
    159 training part of dataset and testing part of dataset. We wrap out learner and 
    160 choose to use internal cross validation and no other reliability estimate.  
    161  
    162 Internal cross validation is performed on the training part of dataset and it 
    163 chooses the best method. Now this method is training on whole training dataset 
    164 and used on test dataset to estimate the reliabiliy. 
    165  
    166 We are interested in the most reliable examples in our testing dataset. We 
    167 extract the estimates and id's, sort them and output them. 
    168  
    169145.. _reliability-run.py: code/reliability-run.py 
    170146.. _housing.tab: code/housing.tab 
     
    206182labels = ["SAvar", "SAbias", "BAGV", "CNK", "LCV", "BVCK", "Mahalanobis", "ICV"] 
    207183 
     184""" 
    208185# All the estimators calculation constants 
    209186DO_SA = 0 
     
    213190DO_BVCK = 4 
    214191DO_MAHAL = 5 
     192""" 
    215193 
    216194# All the estimator method constants 
  • orange/doc/Orange/rst/code/reliability-long.py

    r7924 r8903  
    1616                                 estimate[0], estimate[1]) 
    1717 
    18 reliability.use[Orange.evaluation.reliability.DO_SA] = False 
     18reliability = Orange.evaluation.reliability.Learner(knn, estimators=[Orange.evaluation.reliability.SensitivityAnalysis()]) 
    1919 
    2020res = Orange.evaluation.testing.cross_validation([reliability], table) 
     
    3232test = table.select(indices, 1) 
    3333 
    34 reliability = Orange.evaluation.reliability.Learner(knn, icv=True, \ 
    35                                                     use=[False, False, False, False, False, False]) 
     34reliability = Orange.evaluation.reliability.Learner(knn, icv=True) 
    3635res = Orange.evaluation.testing.learn_and_test_on_test_data([reliability], train, test) 
    3736 
    3837print 
    39 print "Method used in internal cross-validation: ", Orange.evaluation.reliability.METHOD_NAME[res.results[0].probabilities[0].reliability_estimate[0][3]] 
     38print "Method used in internal cross-validation: ", Orange.evaluation.reliability.METHOD_NAME[res.results[0].probabilities[0].reliability_estimate[0].method] 
    4039 
    41 top5 = sorted((abs(result.probabilities[0].reliability_estimate[0][0]), id) for id, result in enumerate(res.results))[:5] 
     40top5 = sorted((abs(result.probabilities[0].reliability_estimate[0].estimate), id) for id, result in enumerate(res.results))[:5] 
    4241for estimate, id in top5: 
    4342    print "%7.3f %i" % (estimate, id) 
Note: See TracChangeset for help on using the changeset viewer.