Search code examples
machine-learningscikit-learnscalingdata-processingdata-transform

Understanding the percent change effect after applying MinMaxScaler?


I wanted to know if the percent change between two values remains the same after scaling the data using MinMaxScaler from scikitlearn.

If not which scaling method should I use in order to make sure that the percentage change remains the same after scaling?


Solution

  • No it does not. As in the docs (https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.MinMaxScaler.html), it follows the equation: transform = scale * X+min - X.min * scale where scale = (max-min)/(X.max-X.min). The percent difference will not stay the same because we are doing addition.

    To ensure the percentage change stays the same, the only way is to only multiply, you cannot do any other operations. You should pick a max or a min and then do some division to find the right number to multiply the whole array by.