Changeset 7752:04bd4603f9f2 in orange


Ignore:
Timestamp:
03/15/11 17:37:40 (3 years ago)
Author:
jzbontar <jure.zbontar@…>
Branch:
default
Convert:
740acd1f10088836cd59cc02a37c51b69bb0c588
Message:

Rename camel case identifiers in Orange.evaluation.testing

Location:
orange
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orange/doc/Orange/rst/code/testing-test.py

    r7738 r7752  
    11import Orange 
     2import orngTest 
    23import random 
     4import Orange.evaluation.testing 
    35 
    46table = Orange.data.Table("voting") 
     
    1719print "\nproportionsTest that will always give the same results" 
    1820for i in range(3): 
    19     res = Orange.evaluation.testing.proportionTest(learners, table, 0.7) 
     21    res = Orange.evaluation.testing.proportion_test(learners, table, 0.7) 
    2022    printResults(res) 
    2123 
     
    2426myRandom = Orange.core.RandomGenerator() 
    2527for i in range(3): 
    26     res = Orange.evaluation.testing.proportionTest(learners, table, 0.7, 
     28    res = Orange.evaluation.testing.proportion_test(learners, table, 0.7, 
    2729        randomGenerator=myRandom) 
    2830    printResults(res) 
     
    3234    print "\nproportionsTest that will give different results each time it is run" 
    3335    for i in range(3): 
    34         res = Orange.evaluation.testing.proportionTest(learners, table, 0.7, 
     36        res = Orange.evaluation.testing.proportion_test(learners, table, 0.7, 
    3537            randseed=random.randint(0, 100)) 
    3638        printResults(res) 
     
    3840 
    3941print "\nproportionsTest + storing classifiers" 
    40 res = Orange.evaluation.testing.proportionTest(learners, table, 0.7, 100, 
     42res = Orange.evaluation.testing.proportion_test(learners, table, 0.7, 100, 
    4143    storeClassifiers=1) 
    4244print "#iter %i, #classifiers %i" % \ 
     
    4446 
    4547print "\nGood old 10-fold cross validation" 
    46 res = Orange.evaluation.testing.crossValidation(learners, table) 
     48res = Orange.evaluation.testing.cross_validation(learners, table) 
    4749printResults(res) 
    4850 
    4951print "\nLearning curve" 
    5052prop = Orange.core.frange(0.2, 1.0, 0.2) 
    51 res = Orange.evaluation.testing.learningCurveN(learners, table, folds=5, 
     53res = Orange.evaluation.testing.learning_curve_n(learners, table, folds=5, 
    5254    proportions=prop) 
    5355for i in range(len(prop)): 
     
    6062train = table.select(indices, 0) 
    6163test = table.select(indices, 1) 
    62 res = Orange.evaluation.testing.learningCurveWithTestData(learners, train, 
     64res = Orange.evaluation.testing.learning_curve_with_test_data(learners, train, 
    6365    test, times=5, proportions=prop) 
    6466for i in range(len(prop)): 
     
    6870 
    6971print "\nLearning and testing on pre-separated data" 
    70 res = Orange.evaluation.testing.learnAndTestOnTestData(learners, train, test) 
     72res = Orange.evaluation.testing.learn_and_test_on_test_data(learners, train, test) 
    7173printResults(res) 
    7274 
    7375print "\nLearning and testing on the same data" 
    74 res = Orange.evaluation.testing.learnAndTestOnLearnData(learners, table) 
     76res = Orange.evaluation.testing.learn_and_test_on_learn_data(learners, table) 
    7577printResults(res) 
  • orange/fixes/fix_changed_names.py

    r7750 r7752  
    380380           "orngEnsemble.SplitConstructor_AttributeSubset":"Orange.ensemble.forest.SplitConstructor_AttributeSubset", 
    381381 
    382            "orngTest.proportionTest":"Orange.evaluation.testing.proportionTest", 
    383            "orngTest.leaveOneOut":"Orange.evaluation.testing.leaveOneOut", 
    384            "orngTest.crossValidation":"Orange.evaluation.testing.crossValidation", 
    385            "orngTest.testWithIndices":"Orange.evaluation.testing.testWithIndices", 
    386            "orngTest.learningCurve":"Orange.evaluation.testing.learningCurve", 
    387            "orngTest.learningCurveN":"Orange.evaluation.testing.learningCurveN", 
    388            "orngTest.learningCurveWithTestData":"Orange.evaluation.testing.learningCurveWithTestData", 
    389            "orngTest.learnAndTestOnTestData":"Orange.evaluation.testing.learnAndTestOnTestData", 
    390            "orngTest.learnAndTestOnLearnData":"Orange.evaluation.testing.learnAndTestOnLearnData", 
    391            "orngTest.testOnData":"Orange.evaluation.testing.testOnData", 
     382           "orngTest.proportionTest":"Orange.evaluation.testing.proportion_test", 
     383           "orngTest.leaveOneOut":"Orange.evaluation.testing.leave_one_out", 
     384           "orngTest.crossValidation":"Orange.evaluation.testing.cross_validation", 
     385           "orngTest.testWithIndices":"Orange.evaluation.testing.test_with_indices", 
     386           "orngTest.learningCurve":"Orange.evaluation.testing.learning_curve", 
     387           "orngTest.learningCurveN":"Orange.evaluation.testing.learning_curve_n", 
     388           "orngTest.learningCurveWithTestData":"Orange.evaluation.testing.learning_curve_with_test_data", 
     389           "orngTest.learnAndTestOnTestData":"Orange.evaluation.testing.learn_and_test_on_test_data", 
     390           "orngTest.learnAndTestOnLearnData":"Orange.evaluation.testing.learn_and_test_on_learn_data", 
     391           "orngTest.testOnData":"Orange.evaluation.testing.test_on_data", 
    392392           "orngTest.TestedExample":"Orange.evaluation.testing.TestedExample", 
    393393           "orngTest.ExperimentResults":"Orange.evaluation.testing.ExperimentResults", 
  • orange/orngTest.py

    r7413 r7752  
    1 from Orange.evaluation.testing import * 
     1from Orange.evaluation.testing import \ 
     2    encode_PP as encodePP,\ 
     3    TestedExample,\ 
     4    ExperimentResults,\ 
     5    leave_one_out as leaveOneOut,\ 
     6    proportion_test as proportionTest,\ 
     7    cross_validation as crossValidation,\ 
     8    learning_curve_n as learningCurveN,\ 
     9    learning_curve as learningCurve,\ 
     10    learning_curve_with_test_data as learningCurveWithTestData,\ 
     11    test_with_indices as testWithIndices,\ 
     12    learn_and_test_on_test_data as learnAndTestOnTestData,\ 
     13    learn_and_test_on_learn_data as learnAndTestOnLearnData,\ 
     14    test_on_data as testOnData 
     15     
     16 
     17''' 
     18RENAMED METHODS: 
     19 
     20TestedExample.addResult -> TestedExample.add_result 
     21TestedExample.setResult -> TestedExample.set_result 
     22ExperimentResults.loadFromFiles -> ExperimentResults.load_from_files 
     23ExperimentResults.saveToFiles -> ExperimentResults.save_to_files 
     24''' 
Note: See TracChangeset for help on using the changeset viewer.