I am working with Sklearn and Tensorflow. I made a successful prediction and now I have a problem with inversion of values from prediction. I want to make an inversion because I want to see metrics from this model. At the beginning I made this transformation of data with Sklearn.
from sklearn.preprocessing import MinMaxScaler
scaler = MinMaxScaler(feature_range = (0,1))
dataset = scaler.fit_transform(df)
type(dataset),dataset.shape
(numpy.ndarray, (425, 3))
After successful execution of TensorFlow model next step is prediction. I made prediction with lines of codes
trainPredict = model.predict(trainX)
testPredict = model.predict(testX)
trainPredict.shape,testPredict.shape
((406, 7, 1), (58, 7, 1))
type(trainPredict),type(testPredict)
(numpy.ndarray, numpy.ndarray)
So the next step is inversion. I try to do inversion with this line of code
# invert predictions
trainPredict_ = scaler.inverse_transform(trainPredict)
trainY_ = scaler.inverse_transform([trainY])
testPredict_ = scaler.inverse_transform(testPredict)
testY_ = scaler.inverse_transform([testY])
After execution of last block of code I get this error:
ValueError: Found array with dim 3. Estimator expected <= 2.