Orange Forum • View topic - BoostedClassifier bug with fix

BoostedClassifier bug with fix

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.

BoostedClassifier bug with fix

Postby vomjom » Tue Oct 10, 2006 13:33

In class BoostedClassifier, on the line:
index = orngMisc.selectBestIndex(votes)

I was getting a None value for the index, causing an exception on the next line.

The reason this is happening is in the class BestOnTheFly, on function winnerIndex()
def winnerIndex(self):
if self.best:
return self.bestIndex
else:
return None

The problem here is that self.best could potentially be 0 causing it to return None (because 0 evaluates to False here).

So just change the if statement to:
if self.best is not None:

and it works.

Thanks for orange by the way!

Postby Blaz » Sat Oct 14, 2006 17:40

Thanks for the bug report - I've fixed orngMisc as you proposed and put it on CVS.


Return to Bugs