I am doing auto encoder model.I have saved the model before which I scaled the data using min max scaler.
X_train = df.values
scaler = MinMaxScaler()
X_train_scaled = scaler.fit_transform(X_train)
After doing this I fitted the model and saved it as 'h5' file.Now when I give test data, after loading the saved model naturally it should be scaled as well.
So when I load the model and scale it by using
X_test_scaled = scaler.transform(X_test)
It gives the error
NotFittedError: This MinMaxScaler instance is not fitted yet. Call 'fit' with appropriate arguments before using this method.
So I gave X_test_scaled = scaler.fit_transform(X_test)
(Which I had a hunch that it is foolish)did gave a result(after loading saved model and test) which was different when I trained it and test it together. I have saved around 4000 models now for my purpose(So I cant train and save it all again as it costs a lot time,So I want a way out).
Is there a way I can scale the test data by transforming it the way I trained it(may be saving the scaled values, I do not know).Or may be descale the model so that I can test the model on non-scaled data.
If I under-emphasized or over-emphasized any point ,please let me know in the comments!