Orange Forum • View topic - Bug in "proportionTest" of orngTest

Bug in "proportionTest" of orngTest

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.

Bug in "proportionTest" of orngTest

Postby PedroAlmeida » Wed Jan 16, 2008 18:04

When calling proportionTest using a regressor (domain.classVar.varType is continuous), the module generates an error.

I corrected the problem by making the following change around line 143 where is:
Code: Select all
testResults = ExperimentResults(times, [l.name for l in learners], examples.domain.classVar.values.native(), weight!=0, examples.domain.classVar.baseValue)

I propose:
Code: Select all
classVar = examples.domain.classVar
if examples.domain.classVar.varType == orange.VarTypes.Discrete:
    values = classVar.values.native()
    baseValue = classVar.baseValue
else:
    values = None
    baseValue = -1
testResults = ExperimentResults(times, [l.name for l in learners], values, weight!=0, baseValue)

Which actually is done in some other places on this module.

Postby Blaz » Thu Jan 17, 2008 6:42

Pedro, many thanks, the module with propose changes is now on CVS.


Return to Bugs



cron