-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] Preprocess: pickle when saving #2289
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2289 +/- ##
==========================================
- Coverage 73.29% 73.29% -0.01%
==========================================
Files 317 317
Lines 55512 55532 +20
==========================================
+ Hits 40687 40701 +14
- Misses 14825 14831 +6 |
How can this issue be reproduced? |
@kernc : Added the steps above. |
"Indicators, FirstAsBase, FrequentAsBase," | ||
"Remove, RemoveMultinomial, ReportError, AsOrdinal," | ||
"AsNormalizedOrdinal, Leave") | ||
class ContinuizeDV(Enum): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before, you'd get:
>>> from Orange.preprocess import Continuize
>>> preproc = Continuize(multinomial_treatment=Continuize.FrequentAsBase)
>>> preproc
Continuize(multinomial_treatment=Continuize.FrequentAsBase)
With this change, it's:
>>> preproc = Continuize(multinomial_treatment=Continuize.FrequentAsBase)
>>> preproc
Continuize(multinomial_treatment=2)
Is there some way to keep the customized Enum and still pickle numbers?
Or, as an alternative, sklearn uses expressive strings. I wouldn't mind that also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kernc: I did some changes.
ReportError = "ReportError" | ||
AsOrdinal = "AsOrdinal" | ||
AsNormalizedOrdinal = "AsNormalizedOrdinal" | ||
Leave = "Leave" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't oppose strings at all. They are simple and robust. Sklearn is all strings in params, and nobody is complaining. But sklearn checks their user input for invalid values. Could we check the passed argument is valid? E.g.:
assert multinomial_treatment in self._MultinomialTreatment
"Indicators, FirstAsBase, FrequentAsBase," | ||
"Remove, RemoveMultinomial, ReportError, AsOrdinal," | ||
"AsNormalizedOrdinal, Leave") | ||
class ContinuizeDV(Enum): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can name this MultinomialTreatment
is it's an enumeration of such methods?
Solved in #2409. |
Issue
Preprocess widget is unable to save Randomize, Normalize Features, and Continuize Discrete Variables due to some pickle error.
Steps to reproduce the behavior
Add Randomize or Normalize Features or Continuize Discrete Variables. Change some parameters. Save the workflow and close the application Orange. Then run the app and open the workflow.
Description of changes
Includes