Kulbear/stock-prediction

how to revert pred values to normal?

jitendra5984 opened this issue · 0 comments

Hi
Can you please help with scale back those prediction value function?

I tried this but values are bit different
Note: made preprocessor as global variable

def normalize_data(x, y):
global preprocessor
linear_x = x.reshape((x.shape[0], x.shape[1] * x.shape[2]))
#print("x.shape", x.shape)
#print("linear_x.shape", linear_x.shape)
xy = np.c_[ linear_x, y, y, y, y, y, y]
#print("xy.shape", xy.shape)
xy_scaled = preprocessor.inverse_transform(xy, copy=True)
#print("xy_scaled.shape", xy_scaled.shape)
#print(xy_scaled[:, -1].tolist())

return xy_scaled[:, -1].tolist()

Will be waiting for your reply