Stock price prediction is a significant challenge in financial industry due to market complexity and volatility. Current research on Apple stock forecasting often uses limited model comparisons and lacks systematic optimization, like Long Short-Term Memory (LSTM), resulting in constrained robustness across varying market conditions. This study employs and optimizes machine learning models for predicting the direction of Apple Inc.'s stock price. The research used daily trading data from 2013 to 2023 and implemented four baseline modelsLogistic Regression, Random Forest, Extreme Gradient Boosting (XGBoost), and LSTM after data preprocessing and feature selection. The baseline evaluation revealed significant fitting issues, including underfitting in linear models and overfitting in tree-based models and LSTM. To address these limitations, this study applied optimization framework, including incorporating feature engineering techniques such as creating lagged variables and rolling statistics, and hyperparameter tuning. This application substantially improved model performance and generalization capability. The optimized LSTM and XGBoost models emerged as top performers, achieving accuracies of 71% and 70%, with AUC scores of 0.78. The findings demonstrate that predictive performance depends not only on algorithm selection but also on integrated working steps including data preprocessing, model-specific adjustments, and experimental design. This research provides a methodological framework for addressing complex forecasting challenges in financial time series.
Chenfeng Wang (Thu,) studied this question.