Preprint / Version 1

Predicting stock prices using linear and non linear machine learning models

##article.authors##

  • Ishaan Bondre Eastlake high school

DOI:

https://doi.org/10.58445/rars.3182

Keywords:

Machine Learning, Computer science, finance, investing

Abstract

Predicting stock price movements is inherently difficult due to market volatility and the influence of numerous external factors. This study develops a machine learning framework that leverages historical opening prices to forecast short-term stock prices for selected publicly traded companies. Using five years of daily data, the model incorporated features from three consecutive opening prices to predict the subsequent day’s opening price. Four machine learning models were trained and evaluated: Linear Regression, Decision Tree, Random Forest, and Neural Network. Performance was assessed using mean squared error (MSE), with the Random Forest model achieving the lowest error, followed closely by the Neural Network. An ensemble approach that combined model predictions yielded a slight further reduction in error. To illustrate potential applications, a simple trading simulation was conducted using linear regression predictions, which showed that under ideal conditions a $500 investment in Microsoft stock could grow substantially. While the models demonstrated only modest predictive accuracy, the limited feature set constrains their ability to generalize. Future research should investigate richer input features, advanced validation techniques, and hyperparameter optimization to improve forecasting reliability.

References

Fischer, Thomas, and Christopher Krauss. “Deep Learning with Long Short-Term Memory Networks for Financial Market Predictions.” European Journal of Operational Research, vol. 270, no. 2, 2018, pp. 654–669. Elsevier, doi:10.1016/j.ejor.2017.11.054.

Kara, Yakup, Melek A. Boyacioglu, and Ömer K. Baykan. “Predicting Direction of Stock Price Index Movement Using Artificial Neural Networks and Support Vector Machines: The Sample of the Istanbul Stock Exchange.” Expert Systems with Applications, vol. 38, no. 5, 2011, pp. 5311–5319. Elsevier, doi:10.1016/j.eswa.2010.10.027.

Patel, Jigar, et al. “Predicting Stock and Stock Price Index Movement Using Trend Deterministic Data Preparation and Machine Learning Techniques.” Expert Systems with Applications, vol. 42, no. 1, 2015, pp. 259–268. Elsevier, doi:10.1016/j.eswa.2014.07.040.

Selvin, Sreelekshmi, et al. “Stock Price Prediction Using LSTM, RNN and CNN-Sliding Window Model.” 2017 International Conference on Advances in Computing, Communications and Informatics (ICACCI), 2017, pp. 1643–1647. IEEE, doi:10.1109/ICACCI.2017.8126078.

Downloads

Posted

2025-10-05