-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
PMStandardScaler
fails when scale = 0
#124
Comments
Why we should modify the scale to 1 when this is 0 ? 😄 |
we should have a look how this is done in scikit-learn : https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html |
We are doing sklearn is also setting scale to 1. |
ok great if they use the same trick. I find the Python code here: https://github.com/scikit-learn/scikit-learn/blob/7813f7efb/sklearn/preprocessing/data.py#L62 |
Can you propose a fix, should be easy ? |
One of the fix is to modify this method: PolyMath/src/Math-PrincipalComponentAnalysis/PMStandardizationScaler.class.st Lines 24 to 26 in aaad4b2
To calculate sqrt for every element, compare to 0, and return sqrt or 1. Other way is to add a Do you want me to create PR using first suggested fix? |
Maybe later will have multiple type of scalin, but at the moment, we have only one. |
PMStandardScaler
fails when scale = 0
A relevant example:
Possible fix: add a "handleZeroScale" method which changes scale to 1 when it is 0.
Question: Can this be method be added in
PMDataTransformer
? If we add more scalers in future, all would need this message.The text was updated successfully, but these errors were encountered: