def getLearningCurve(self, learners):   
     pb = OWGUI.ProgressBar(self, iterations=self.steps*self.folds)
     if not self.testdata:
         curve = orngTest.learningCurveN(learners, self.data, folds=self.folds, proportions=self.curvePoints, callback=pb.advance)
     else:
         curve = orngTest.learningCurveWithTestData(learners,
           self.data, self.testdata, times=self.folds, proportions=self.curvePoints, callback=pb.advance)            
     pb.finish()
     return curve
예제 #2
0
 def getLearningCurve(self, learners):
     pb = OWGUI.ProgressBar(self, iterations=self.steps * self.folds)
     if not self.testdata:
         curve = orngTest.learningCurveN(learners,
                                         self.data,
                                         folds=self.folds,
                                         proportions=self.curvePoints,
                                         callback=pb.advance)
     else:
         curve = orngTest.learningCurveWithTestData(
             learners,
             self.data,
             self.testdata,
             times=self.folds,
             proportions=self.curvePoints,
             callback=pb.advance)
     pb.finish()
     return curve
예제 #3
0
res = orngTest.crossValidation(learners, data)
printResults(res)

print "\nLearning curve"
prop = orange.frange(0.2, 1.0, 0.2)
res = orngTest.learningCurveN(learners, data, folds=5, proportions=prop)
for i in range(len(prop)):
    print "%5.3f:" % prop[i],
    printResults(res[i])

print "\nLearning curve with pre-separated data"
indices = orange.MakeRandomIndices2(data, p0=0.7)
train = data.select(indices, 0)
test = data.select(indices, 1)
res = orngTest.learningCurveWithTestData(learners,
                                         train,
                                         test,
                                         times=5,
                                         proportions=prop)
for i in range(len(prop)):
    print "%5.3f:" % prop[i],
    printResults(res[i])

print "\nLearning and testing on pre-separated data"
res = orngTest.learnAndTestOnTestData(learners, train, test)
printResults(res)

print "\nLearning and testing on the same data"
res = orngTest.learnAndTestOnLearnData(learners, data)
printResults(res)
예제 #4
0
print "\nGood old 10-fold cross validation"
res = orngTest.crossValidation(learners, data)
printResults(res)


print "\nLearning curve"
prop = orange.frange(0.2, 1.0, 0.2)
res = orngTest.learningCurveN(learners, data, folds = 5, proportions = prop)
for i in range(len(prop)):
    print "%5.3f:" % prop[i],
    printResults(res[i])

print "\nLearning curve with pre-separated data"
indices = orange.MakeRandomIndices2(data, p0 = 0.7)
train = data.select(indices, 0)
test = data.select(indices, 1)
res = orngTest.learningCurveWithTestData(learners, train, test, times = 5, proportions = prop)
for i in range(len(prop)):
    print "%5.3f:" % prop[i],
    printResults(res[i])


print "\nLearning and testing on pre-separated data"
res = orngTest.learnAndTestOnTestData(learners, train, test)
printResults(res)

print "\nLearning and testing on the same data"
res = orngTest.learnAndTestOnLearnData(learners, data)
printResults(res)