1
$\begingroup$

I am using MinMaxScaler on a large dataset (2201887, 3) to normalize features. Inversed values does not match originals. I tested with the target column, first (a), I applied the scaler on 10 values, then did the inverse transformation and I was able to get original values. Then (b), I inverted 10 normalized values after applying MinMaxScaler on the whole column and results were completely different : enter image description here

Result of (a) :

enter image description here

Result of (b) :

enter image description here

How can I have the same normalized and inversed values when used with the whole dataset?

$\endgroup$

1 Answer 1

1
$\begingroup$

I wasn't able to reproduce the issue as inverse_transform(b) threw an error because it was trained on a (,3) array but the input is only (,1). Not sure if I typoed or how your code runs.

You could try instantiating a new MinMaxScaler, as I'm not sure if anything weird happens if you refit it.

$\endgroup$
1
  • $\begingroup$ Yes I think that was the problem, I used inverse_transform() on the whole transformed data that has the shape (,3) and it generated the same original values. Thank you for your help. $\endgroup$ Commented Jul 7, 2021 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.