Pull requests

#7 Merged
Repository
ubershmekel
Branch
default
Repository
biolab
Branch
default

Avoid OverflowError when the beta is really high

Author
  1. ubershmekel
Reviewers
Description

I had a logistics regression I wanted to investigate using

print Orange.classification.logreg.dump(in_classifier)

But it broke like so:

>>> math.exp(1234)
Traceback (most recent call last):
  File "logreg.py", line 1, in <module>
OverflowError: math range error

on the math.exp(classifier.beta[i+1]) expression.

  • Learn about pull requests

Comments (1)

  1. astaric

    Thank you for your fix.

    Could you also write a simple test that fails with current implementation but passes with your fix? (You can put it at the bottom of Orange/testing/unit/tests/test_logreg.py.)