Orange Forum • View topic - Mistake in Regression/Cross Validation tutorial

Mistake in Regression/Cross Validation tutorial

A place to ask questions about methods in Orange and how they are used and other general support.

Mistake in Regression/Cross Validation tutorial

Postby sreastman » Mon Jan 28, 2013 19:11

I noticed the example script for the Regression/Cross Validation part of the latest tutorial is not correct. It appears to be copied from the final example in the previous section, Handful of Regressors.

May I suggest the following in its place?

import Orange

data = Orange.data.Table("housing")

lin = Orange.regression.linear.LinearRegressionLearner()
lin.name = "lin"
earth = Orange.regression.earth.EarthLearner()
earth.name = "mars"
tree = Orange.regression.tree.TreeLearner()
tree.name = "tree"

learners = [lin, earth, tree]

print "Learner RMSE"
res = Orange.evaluation.testing.cross_validation(learners, data, folds=5)
RMSE = Orange.evaluation.scoring.RMSE(res)
for i in range(len(learners)):
print "{0:8}".format(learners[i].name),
print "%.2f" % RMSE[i]

I guessed folds=5 since there is no way to know for sure what was originally intended. The results match, except for tree = 5.28 instead of 5.10 which may be attributable to the uncertainty about k or possibly an updated data file.

Steve

Re: Mistake in Regression/Cross Validation tutorial

Postby Blaz » Fri Feb 01, 2013 12:07

Steve, thanks a lot for this bug report. I've change the documentation as you have suggested.

Blaz.


Return to Questions & Support



cron