Changeset 9555:0794875e3658 in orange


Ignore:
Timestamp:
01/20/12 13:34:16 (2 years ago)
Author:
anze <anze.staric@…>
Branch:
default
Convert:
d17f5aa1c47378e5e82dd7df846f1d6ebe9ddca9
Message:

Added deprecated_keywords decorator to learning_curve_n.

File:
1 edited

Legend:

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

    r9540 r9555  
    519519 
    520520 
     521    @deprecated_keywords({"strat": "stratification", 
     522                          "pps": "preprocessors", 
     523                          "indicesrandseed": "random_generator", 
     524                          "randseed": "random_generator", 
     525                          "randomGenerator": "random_generator"}) 
    521526    def learning_curve_n(self, learners, examples, folds=10, 
    522                        proportions=Orange.core.frange(0.1), preprocessors=(), callback=None): 
     527                       proportions=Orange.core.frange(0.1), 
     528                       stratification = Orange.core.MakeRandomIndices 
     529                       .StratifiedIfPossible, 
     530                       preprocessors=(), 
     531                       random_generator=0, callback=None): 
    523532        """ 
    524533        Compute a learning curve where each cross-validation has given number of folds 
     
    534543        """ 
    535544 
    536         seed = argkw.get("indicesrandseed", -1) or argkw.get("randseed", -1) 
    537         if seed: 
    538             randomGenerator = Orange.core.RandomGenerator(seed) 
    539         else: 
    540             randomGenerator = argkw.get("randomGenerator", Orange.core.RandomGenerator()) 
    541  
    542         if strat: 
    543             cv=Orange.core.MakeRandomIndicesCV(folds = folds, stratified = strat, randomGenerator = randomGenerator) 
    544             pick=Orange.core.MakeRandomIndices2(stratified = strat, randomGenerator = randomGenerator) 
    545         else: 
    546             cv=Orange.core.RandomIndicesCV(folds = folds, stratified = strat, randomGenerator = randomGenerator) 
    547             pick=Orange.core.RandomIndices2(stratified = strat, randomGenerator = randomGenerator) 
    548         return learning_curve(learners, examples, cv, pick, proportions, pps, **argkw) 
     545        cv=Orange.core.MakeRandomIndicesCV(folds = folds, 
     546            stratified = stratification, randomGenerator = random_generator) 
     547        pick=Orange.core.MakeRandomIndices2(stratified = stratification, 
     548            randomGenerator = random_generator) 
     549        return learning_curve(learners, examples, cv, pick, proportions, 
     550            preprocessors, callback=callback) 
    549551     
    550552    def learning_curve_with_test_data(self, learners, learn_set, test_set, 
Note: See TracChangeset for help on using the changeset viewer.