A Robust Machine Learning Framework for Stock Price Forecasting Using Feature Optimization and Neural Networks
Abstract
Predicting stock market trends is inherently challenging due to the volatile and nonlinear nature of financial data. To address these complexities, optimization-driven machine learning approaches have gained increasing attention. This study presents a comparative evaluation of machine learning models for predicting the opening and closing prices of IT company stocks using historical market data. The dataset, comprising features such as high price, low price, and trading volume, was pre-processed through linear interpolation to handle missing values and normalized using z-score standardization. Feature engineering was further applied by incorporating a 3-day moving average, while Principal Component Analysis (PCA) reduced dimensionality while preserving 95% of the data variance. The models evaluated include Artificial Neural Networks (ANN), Linear Regression (LR), and Support Vector Regression (SVR). A grid search was employed to optimize the number of hidden neurons in the ANN, resulting in an optimal configuration for Microsoft and IBM data. Comparative analysis indicated that the ANN consistently outperformed both LR and SVR across all evaluation metrics for predicting opening and closing prices.