Random forest regression model for stock price prediction output has a flat line in the predicted values during the initial values

Random forest regression model for stock price prediction output has a flat line in the predicted values during the initial values

Manage alerts

Loading saved threads...

ANA · External communityPost link
External question — Data Science Stack Exchange Author: ANA Original post: https://datascience.stackexchange.com/questions/128959 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I have a random forest regression model for predicting the close price for stock data. I am getting model accuracy as like this: /n Best Parameters: {'max_depth': 10, 'min_samples_leaf': 2, 'min_samples_split': 2, 'n_estimators': 50} Model Accuracy: 0.9836086637624329 Mean Squared Error: 0.0012209441316212947 R-squared (Coefficient of Determination): 0.9836086637624329 I have used GridSearch for best parameters. I want to confirm the model is not overfit. I have done the below plots: I am wondering why the residual plot has initial straight line portion. I will also add the learning curve and actual v/s predicted. Somebody please help me to understand what causes this inconsistency in the model?
Quote
Report
Oxbowerce · External communityPost link
External answer — Data Science Stack Exchange Author: Oxbowerce Original post: https://datascience.stackexchange.com/a/128960 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. It is hard to say without knowing the time of inputs you are providing your model, but apparently based on the learned patterns in the training data most of the days as the start of your test data end up in the same leaf node leading to the same prediction. Additionally, the random forest model can't predict lower values than it has seen in its training set, so it will never be able to predict the closing prices of around 100 that are present in the test data.
Quote
Report

Post Reply

Checking account access…