Orange Forum • View topic - Using Test Learners widget for Regression

Using Test Learners widget for Regression

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

Using Test Learners widget for Regression

Postby JoeM » Wed Oct 17, 2012 10:19

Hello!

Firstly, I must say I am new to orange. I cannot make the Test Learners widget work with regression learners. My workflow is in the image below. The Test Learners is having a problem with the data (I suppose) - as seen in the picture; other regression methods (I've tried Knn, Random Forrest Regression,..) always report similar problems (e.g. "index out of range" for knn).

I am sure that the file is loaded properly, I can see it in the Data Table widget, also the info (or the File info) gives correct information - I have 114 continuous attributes and 1 continuous class.

I have made (well, more like copied it from examples) a script, which should (I think) do "the same" kind of evaluation, and it works ok.

Can someone explain what am I doing wrong?

Btw. I have tried this with the orange.version == '2.0b (15:11:32, Jan 24 2012)' and also with the current dev version. Also, I have uploaded the data tab http://j2m.cz/my_upload_files/str_data1.tab and the widget schema http://j2m.cz/my_upload_files/str1.ows if this would be of some help.

Thanks in advance!

Code: Select all
import Orange

data = Orange.data.Table('str_data1.tab')
learners = [Orange.regression.earth.EarthLearner(),
            Orange.classification.svm.SVMLearner()]
cv = Orange.evaluation.testing.cross_validation(learners, data, folds=4)
print ["%.4f" % score for score in Orange.evaluation.scoring.MSE(cv)]


Image

Re: Using Test Learners widget for Regression

Postby Ales » Wed Oct 17, 2012 11:37

This was an bug with a learner precheck and not limited to regression.
I fixed the bug, it should be included in tomorrows development snapshots.

Re: Using Test Learners widget for Regression

Postby JoeM » Wed Oct 17, 2012 12:00

Ok, thanks for a quick reply - it works! Thought not flawlessy, the TestLearner reports button shows report log with the following exception:

Unhandled exception of type AttributeError occured at 13:01:23:
Traceback:
File: OWWidget.py, line 169 in reportAndFinish
Code: self.sendReport()
File: OWTestLearners.py, line 275 in sendReport
Code: ([("Target class", self.data.domain.classVar.values[self.targetClass])] if self.data else []))
AttributeError: 'Orange.feature.Continuous' has no attribute 'values'


Should I ignore this?

Re: Using Test Learners widget for Regression

Postby Ales » Wed Oct 17, 2012 13:12

JoeM wrote:Unhandled exception of type AttributeError occured at 13:01:23:
Traceback:
File: OWWidget.py, line 169 in reportAndFinish
Code: self.sendReport()
File: OWTestLearners.py, line 275 in sendReport
Code: ([("Target class", self.data.domain.classVar.values[self.targetClass])] if self.data else []))
AttributeError: 'Orange.feature.Continuous' has no attribute 'values'

Fixed in the main development repository.

Re: Using Test Learners widget for Regression

Postby JoeM » Wed Oct 17, 2012 13:23

Thanks again, I confirm both fixes.


Return to Questions & Support



cron