biolab / orange3-educational

🍊 🎓 Educational widgets for machine learning and data mining in Orange 3.
Other
27 stars 20 forks source link

[ENH] Polynomial regression - warn about huge values #158

Closed PrimozGodec closed 1 year ago

PrimozGodec commented 1 year ago
Issue

Polynomial features can become huge due to the exponentiation of numbers. Huge numbers (and number differences) can cause model algorithms to be numerically unstable. For example, a higher degree of polynomial features should result in a better fit to the curve, but when numbers are high and linear regression weight becomes really small, it is not the case anymore (because of numeric instability):

Screenshot 2023-04-03 at 11 09 38

Description of changes

It can be fixed with normalization, but as discussed with Tomaz, it is better just to warn since it is an educational add-on, and we do not want to do any values changing in the background (which would also affect the model weights).

Includes
codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02 :tada:

Comparison is base (474dcf6) 82.89% compared to head (9da80d1) 82.92%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #158 +/- ## ========================================== + Coverage 82.89% 82.92% +0.02% ========================================== Files 18 18 Lines 3104 3109 +5 Branches 360 361 +1 ========================================== + Hits 2573 2578 +5 Misses 478 478 Partials 53 53 ``` | [Impacted Files](https://codecov.io/gh/biolab/orange3-educational/pull/158?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biolab) | Coverage Δ | | |---|---|---| | [...trib/educational/widgets/owpolynomialregression.py](https://codecov.io/gh/biolab/orange3-educational/pull/158?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biolab#diff-b3JhbmdlY29udHJpYi9lZHVjYXRpb25hbC93aWRnZXRzL293cG9seW5vbWlhbHJlZ3Jlc3Npb24ucHk=) | `93.92% <100.00%> (+0.09%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biolab). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biolab)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.