Open sounds opened 8 months ago
it seems that you do twice inverse_transform for train_predict.
# Make predictions
train_predict = model.predict(X_train)
test_predict = model.predict(X_test)
# Inverse transform predictions
train_predict = scaler.inverse_transform(train_predict)
test_predict = scaler.inverse_transform(test_predict)
# Evaluate the model (Optional: Calculate RMSE or other metrics)
train_rmse = math.sqrt(mean_squared_error(y_train, scaler.inverse_transform(train_predict.reshape(-1, 1))))
test_rmse = math.sqrt(mean_squared_error(y_test, scaler.inverse_transform(test_predict.reshape(-1, 1))))
print(f"Train RMSE: {train_rmse}")
print(f"Test RMSE: {test_rmse}")
Hi,I Try to add new feature like Volume,but get bad result. so I copy Close as 2nd feature to get same result,but failed. Can you help me find some err of my code ?