Invert MinMaxScaler from scikit_learn

Let us start by defining a pandas dataframe:

cols = ['A', 'B']
data = pd.DataFrame(np.array([[2,3],[1.02,1.2],[0.5,0.3]]),columns=cols)

enter image description here

The we scale the data using the MinMaxScaler

scaler = preprocessing.MinMaxScaler(feature_range = (0,1))
scaled_data = scaler.fit_transform(data[cols])

enter image description here

Now, to invert the transformation you should call the inverse transform:

scaler.inverse_transform(scaled_data)

enter image description here


You do that with inverse transform.