I have a NumPy array and I want to normalize each column differently. Means 1st column should be normalized between 0 to 1, second and third between -1 to 1 and 4th column between 0 to 1. How can I do it? MinMaxScaler scale every column between 0 to 1.
Asked
Active
Viewed 123 times
1
-
In sklearn.preprocessing.MinMaxScaler, you can choose the normalization range with the parameter feature_range: https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.MinMaxScaler.html – jhihan Oct 15 '20 at 11:16
-
The problem would be it would take this max and min value for the whole matrix, while i want it to be different for different columns – A R. Oct 15 '20 at 11:17
-
2I think this post might answer your question: https://stackoverflow.com/questions/43834242/sklearn-minmaxscaler-scale-specific-columns-only – jhihan Oct 15 '20 at 11:27