Last answered:

20 Nov 2023

Posted on:

16 Nov 2022

3

Do we have to scale the data to exactly (-1,1) range?

Do we have to scale the data to exactly (-1,1) range? Could it be (0,1) or could we just standardize it? If not - why?
Also, when we scale the test data with MinMaxScaler fitted to train data we may not get (-1,1) range. Could it be a problem?

1 answers ( 0 marked as helpful)
Posted on:

20 Nov 2023

0

Answering your second question when using the scaling on test data the range could be exceeded and the reason is that the formula used for MinMaxScaler is like = X_scaled = X_std * (max-min) + min
Where max and min values come from train data that you've fitted on. So if the max and min values differ on the testing data it goes out of range

Submit an answer