Good practice usage with the MinMaxScaler and other scaling techniques is as follows:
Fit the scaler using available training data . For normalization, this means the training data will be used to estimate the minimum and maximum observable values. This is done by calling the fit() function.
Apply the scale to training data . This means you can use the normalized data to train your model. This is done by calling the transform() function.
Apply the scale to data going forward . This means you can prepare new data in the future on which you want to make predictions. If needed, the transform can be inverted. This is useful for converting predictions back into their original scale for reporting or plotting. This can be done by calling the inverse transform() function.
Below is an example of normalizing a contrived sequence of 10 quantities. The scaler object requires data to be provided as a matrix of rows and columns. The loaded time series data is loaded as a Pandas Series