forecast values testpredict seq_lstm_model predict(testpredictevaluate performance testscore math sqrt(mean_squared_error(test_y[ ]testpredict[ ][:test_x shape[ ]])print('test score rmse(testscore)test score rmse we can perform the same steps on the training set as well and check the performance while generating the train and test datasetsthe function get_seq_train_test(also returned the scaler object we next use this scaler object to perform an inverse transformation to get the prediction values in the original scale the following snippet performs inverse transformation and then plots the series in [ ]inverse transformation trainpredict scaler inverse_transform(trainpredict reshape(trainpredict shape[ ])testpredict scaler inverse_transform(testpredict reshape(testpredict shape[ ])train_size len(trainpredict)+ plot the true and forecasted values plt plot(sp_close_series indexsp_close_series values, ='black'alpha= ,label='true data'plt plot(sp_close_series index[ :train_size]trainpredictlabel='training fit', =' 'plt plot(sp_close_series index[train_size+ :]testpredict[:test_x shape[ ]]label='forecast'plt title('forecast plot'plt legend(plt show(figure - forecast for & using lstm based sequence modeling