Changeset 7589:5602f2859322 in orange


Ignore:
Timestamp:
02/05/11 00:27:55 (3 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
bf171b8a94f1cf8b3c9d0e4b9183bd1f94824f35
Message:

aced includes with include Orange

Location:
orange/doc/Orange/rst/code
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orange/doc/Orange/rst/code/optimization-thresholding1.py

    r7580 r7589  
    1 import orange, orngWrap, orngTest, orngStat 
     1import Orange 
    22 
    3 data = orange.ExampleTable("bupa") 
     3table = Orange.data.Table("bupa") 
    44 
    5 learner = orange.BayesLearner() 
    6 thresh = orngWrap.ThresholdLearner(learner = learner) 
    7 thresh80 = orngWrap.ThresholdLearner_fixed(learner = learner, threshold = .8) 
    8 res = orngTest.crossValidation([learner, thresh, thresh80], data) 
    9 CAs = orngStat.CA(res) 
     5learner = Orange.classification.bayes.NaiveLearner() 
     6thresh = Orange.optimization.ThresholdLearner(learner=learner) 
     7thresh80 = Orange.optimization.ThresholdLearner_fixed(learner=learner,  
     8                                                      threshold=0.8) 
     9res = testing.crossValidation([learner, thresh, thresh80], table) 
     10CAs = scoring.CA(res) 
    1011 
    1112print "W/out threshold adjustement: %5.3f" % CAs[0] 
  • orange/doc/Orange/rst/code/optimization-thresholding2.py

    r7580 r7589  
    1 import orange, orngWrap, orngTest, orngStat 
     1import Orange 
    22 
    3 data = orange.ExampleTable("bupa") 
    4 ri2 = orange.MakeRandomIndices2(data, 0.7) 
    5 train = data.select(ri2, 0) 
    6 test = data.select(ri2, 1) 
     3table = Orange.data.Table("bupa") 
     4ri2 = Orange.core.MakeRandomIndices2(table, 0.7) 
     5train = table.select(ri2, 0) 
     6test = table.select(ri2, 1) 
    77 
    8 bayes = orange.BayesLearner(train) 
     8bayes = Orange.classification.bayes.NaiveLearner(train) 
    99 
    1010thresholds = [.2, .5, .8] 
    11 models = [orngWrap.ThresholdClassifier(bayes, thr) for thr in thresholds] 
     11models = [Orange.optimization.ThresholdClassifier(bayes, thr) for thr in thresholds] 
    1212 
    13 res = orngTest.testOnData(models, test) 
    14 cm = orngStat.confusionMatrices(res) 
     13res = testing.testOnData(models, test) 
     14cm = scoring.confusionMatrices(res) 
    1515 
    1616print 
  • orange/doc/Orange/rst/code/optimization-tuning1.py

    r7562 r7589  
    1 import Orange.data 
    2 import Orange.optimization 
    3 import Orange.classification 
    4 import Orange.evaluation.scoring as scoring 
    5 import Orange.evaluation.testing as testing 
     1import Orange 
    62 
    73learner = Orange.classification.tree.TreeLearner() 
  • orange/doc/Orange/rst/code/optimization-tuningm.py

    r7562 r7589  
    1 import Orange.data 
    2 import Orange.optimization 
    3 import Orange.classification 
    4 import Orange.evaluation.scoring as scoring 
    5 import Orange.core 
     1import Orange 
    62 
    73learner = Orange.classification.tree.TreeLearner() 
Note: See TracChangeset for help on using the changeset viewer.