I have normalized my data using the following:
scaler = StandardScaler()
train = scaler.fit_transform(train)
test = scaler.transform(test)
I later split my train and test sets into my X and y's:
X_train, y_train = train[:,1:21], train[:, np.shape(train)[1] - 2:]
X_test, y_test = test[:,1:21], test[:, np.shape(test)[1] - 2:]
I then pass these into a complex ML code.
I want to be able to easily revert my y_test
and my y_pred
that gets spit out by this code into their un-normalized scale (for plotting purposes).
I know that y_test = scaler.inverse_transform(y_test)
could be used if transform()
had been applied to y_test
rather than train
.
Is there a solution to this that I am overlooking?