Changeset 39:5e0e4eb49fd1 in orange-reliability


Ignore:
Timestamp:
10/02/13 15:47:44 (7 months ago)
Author:
markotoplak
Branch:
default
Message:

Updated examples

Location:
docs/rst
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • docs/rst/Orange.evaluation.reliability.rst

    r13 r39  
    4444 
    4545.. literalinclude:: code/reliability-run.py 
    46     :lines: 11- 
     46    :lines: 7- 
    4747 
    4848Reliability Methods 
     
    118118  ABSOLUTE = 1 
    119119 
    120 Reliability estimation scoring methods 
    121 ====================================== 
     120Reliability estimation scoring 
     121============================== 
    122122 
    123123.. autofunction:: get_pearson_r 
     
    127127.. autofunction:: get_spearman_r 
    128128 
    129 Example of usage 
    130 ================ 
     129Example 
     130======= 
    131131 
    132132.. literalinclude:: code/reliability-long.py 
    133     :lines: 11-26 
     133    :lines: 7-22 
    134134 
    135135This script prints out Pearson's R coefficient between reliability estimates 
    136136and actual prediction errors, and a corresponding p-value, for each of the 
    137137reliability estimation measures used by default. :: 
    138  
     138   
    139139  Estimate               r       p 
    140140  SAvar absolute        -0.077   0.454 
    141141  SAbias signed         -0.165   0.105 
    142   SAbias absolute       -0.099   0.333 
    143   BAGV absolute          0.104   0.309 
     142  SAbias absolute        0.095   0.352 
     143  LCV absolute           0.069   0.504 
     144  BVCK absolute          0.060   0.562 
     145  BAGV absolute          0.078   0.448 
    144146  CNK signed             0.233   0.021 
    145   CNK absolute           0.057   0.579 
    146   LCV absolute           0.069   0.504 
    147   BVCK_absolute          0.092   0.368 
     147  CNK absolute           0.058   0.574 
    148148  Mahalanobis absolute   0.091   0.375 
    149  
     149  Mahalanobis to center  0.096   0.349 
    150150 
    151151References 
  • docs/rst/code/reliability-long.py

    r2 r39  
    44# Referenced:  Orange.evaluation.reliability 
    55# Classes:     Orange.evaluation.reliability.Learner 
    6  
    7 import Orange 
    8 Orange.evaluation.reliability.select_with_repeat.random_generator = None 
    9 Orange.evaluation.reliability.select_with_repeat.randseed = 42 
    106 
    117import Orange 
     
    2218print "Estimate               r       p" 
    2319for estimate in reliability_res: 
    24     print "%-20s %7.3f %7.3f" % (Orange.evaluation.reliability.METHOD_NAME[estimate[3]], 
     20    print "%-21s%7.3f %7.3f" % (Orange.evaluation.reliability.METHOD_NAME[estimate[3]], 
    2521                                 estimate[0], estimate[1]) 
    2622 
     
    3430print "Estimate               r       p" 
    3531for estimate in reliability_res: 
    36     print "%-20s %7.3f %7.3f" % (Orange.evaluation.reliability.METHOD_NAME[estimate[3]], 
     32    print "%-21s%7.3f %7.3f" % (Orange.evaluation.reliability.METHOD_NAME[estimate[3]], 
    3733                                 estimate[0], estimate[1]) 
    3834 
     
    4137test = prostate.select(indices, 1) 
    4238 
    43 reliability = Orange.evaluation.reliability.Learner(knn, icv=True) 
    44 res = Orange.evaluation.testing.learn_and_test_on_test_data([reliability], train, test) 
     39reliability = Orange.evaluation.reliability.Learner(knn, estimators=[Orange.evaluation.reliability.ICV()]) 
     40reliabilityc = reliability(train) 
     41res = Orange.evaluation.testing.test_on_data([reliabilityc], train, test) 
     42 
     43METHOD_NAME = Orange.evaluation.reliability.METHOD_NAME 
    4544 
    4645print 
    47 print "Method used in internal cross-validation: ", Orange.evaluation.reliability.METHOD_NAME[res.results[0].probabilities[0].reliability_estimate[0].method] 
     46print "Method used in internal cross-validation: ", METHOD_NAME[reliabilityc.estimation_classifiers[0].chosen[0]] 
    4847 
    4948top5 = sorted((abs(result.probabilities[0].reliability_estimate[0].estimate), id) for id, result in enumerate(res.results))[:5] 
  • docs/rst/code/reliability-run.py

    r2 r39  
    44# Referenced:  Orange.evaluation.reliability 
    55# Classes:     Orange.evaluation.reliability.Learner 
    6  
    7 import Orange 
    8 Orange.evaluation.reliability.select_with_repeat.random_generator = None 
    9 Orange.evaluation.reliability.select_with_repeat.randseed = 42 
    106 
    117import Orange 
Note: See TracChangeset for help on using the changeset viewer.