Orange Forum • View topic - storeclassifiers in learnAndTestOnTestData

storeclassifiers in learnAndTestOnTestData

Report bugs (or imagined bugs).
(Archived/read-only, please use our ticketing system for reporting bugs and their discussion.)
Forum rules
Archived/read-only, please use our ticketing system for reporting bugs and their discussion.

storeclassifiers in learnAndTestOnTestData

Postby Michael » Mon Dec 11, 2006 3:45

hi,

There seems to be a problem when setting storeclassifiers =True in orngTest.learnAndTestOnTestData and learnAndTestOnLearnData.

There is a line
if storeclassifiers:
testResults.classifiers.append(classifiers)

However, testResults is does not exist prior to this and raises
AttributeError: 'NoneType' object has no attribute 'classifiers'

An option is to modify the last lines to
testResults = testOnData(classifiers, (testset, testweight), testResults, iterationNumber)
if storeclassifiers:
testResults.classifiers.append(classifiers)
return testResults

Michael

Postby Janez » Mon Dec 11, 2006 19:03

You're right.

It seems that this function and learnAndTestOnLearnData were always called either without storeClassifiers or internally, by other orngTest's functions, which construct testResults in advance, so we never noticed the bug.

Thanks!


Return to Bugs



cron