I been trying to figure this out for the past few hours but I have been having so many issues. I want to use the MinMaxScaler from sklearn.
The formula is like
Xnorm = X-Xmin / Xmax-Xmin
I want to apply that formula to some of the array positions but am having trouble figuring out how to also apply an inverse formula like
Xnorm = Xmax-X / Xmax-Xmin
My attempt: I want to do standardization for the 1st and 3rd value in an array and for the 2nd value in the array I want to get the inverse standardization from the formula above
X = np.array([[-0.23685953, 0.04296864, 0.94160742],
[-0.23685953, 1.05043547, 0.67673782],
[0.12831355, 0.16017461, 0.27031023]])
from sklearn import preprocessing
minmax_scale = preprocessing.MinMaxScaler().fit(X)
X_std = minmax_scale.transform(X.iloc[:,np.r_[1,3])