Standard Scaler for inference time

Hello everyone, I am sorry if this is a dumb question but I’m stuck so please bear with me.

I am trying to forecast a feature for IoT data using LSTMs and one of the preprocessing steps involves ‘Standardization’ which I’m doing through sklearn’s MinMaxScaler function. Now my question is how do I pass the MinMaxScaler to my AWS deployment for similar conversion of data at inference time? I can’t hard code the value because I intend to use the same model architecture over and over for different machines.

Please help me out with this as this is the first time I’m trying to deploy a model. Thanks in advance.

Okay. So this turned out to be a very stupid/basic question. We can do this either by just pickling the scalar as we do for our models or by using the sklearn library itself, like this:

from sklearn.externals import joblib
scaler_filename = "scaler.save"
joblib.dump(scaler, scaler_filename)