Stock Prediction Analysis Based on Logistic Regression and Random Forest
DOI:
https://doi.org/10.61173/7t61wt75Keywords:
Logistic Regression, Random Forest, Stock PredictionAbstract
An important factor in a nation’s economic growth is the stock market. Accurate stock price prediction is vital for investors, financial analysts, and investment institutions. However, the volatility of stock prices makes prediction challenging. Adopting advanced analytical methods can improve prediction accuracy. This paper investigates the application of machine learning (ML) algorithms, such as logistic regression (LR) and random forest (RF) in predicting stock price trends, exploring their value in stock forecasting. Ten daily features, such as opening price, closing price, and trading volume, were utilized to train models. By exploring the impact of the number of historical days on prediction accuracy, the study found that the LR model achieved its highest accuracy (53.8%) when utilizing data from the previous 4 days. Further comparison among models revealed that the RF model outperformed both LR and BP models, achieving the highest prediction accuracy (58.3%) and AUC (0.576). These findings suggest that RF holds promise as a reliable tool for stock price trend forecasting, providing valuable insights for investors seeking more accurate market prediction tools.