AI Stock Price Prediction

AAPL Stock Price Prediction

Recently, I completed a small machine learning project to predict the closing price of Apple's (AAPL) stock. Using historical data from Yahoo Finance and Pytorch, I built an LSTM (Long Short-Term Memory) model to forecast prices based on past market trends. This project provided an opportunity to explore time series forecasting, feature engineering, and data visualisation.

Project Overview:

Data and Features:

I worked with daily stock data spanning from January 2018 to June 2025. The model used the following features to understand market behaviour:

The model predicts the next day's closing price by analysing the past 60 days of data, a sequence length that balances the historical context with efficiency.

Training and Results:

With Apple's average closing price around $131 during the test period, an MAE of 1.8379 means an average prediction error of ~1.40%, indicating a strong result given the unpredictability of stock markets.

The Graph: Actual vs Predicted Prices I used Plotly to create an interactive chart comparing actual and predicted closing prices over time.The closer the orange line tracks the blue line, the more accurate the predictions. The graph shows that the model is able to follow the market trends well.

Challenges and Solutions:What I Learned:

This project helped improve my skills in:

Available here and graph below.