This is my project for the Edunet Foundation - AICTE Internship (IBM SkillsBuild, Artificial Intelligence, 6 weeks). The idea is simple - feed a deep learning model 5 years of a stock's price history and let it learn the pattern well enough to predict the next closing price.
I used Google (GOOG) stock for training, but the same code works for any ticker, just change the symbol.
- Pulls 5 years of historical price data using yfinance
- Scales the data with MinMaxScaler (LSTM works much better on 0-1 range)
- Trains a Sequential model - LSTM + Dropout + Dense layers
- Plots actual vs predicted prices so you can see how close it gets
- Wrapped in a small Streamlit app so anyone can try it from the browser
- Python
- TensorFlow / Keras
- pandas, numpy
- scikit-learn (just for MinMaxScaler)
- matplotlib
- yfinance
- Streamlit (for the web app)
train_model.py- trains the LSTM model and saves itapp.py- the Streamlit apprequirements.txt- everything you need to pip installstock_lstm_model.h5/scaler.save- get created after you run training
- Install the requirements:
pip install -r requirements.txt
- Train the model first (this downloads data and trains, takes a few minutes):
python train_model.py
- Once that's done, run the app:
streamlit run app.py
Then just type in a stock ticker (GOOG, AAPL, TSLA, whatever) and hit Run Prediction.
Got around 95% training accuracy and ~91% on validation, RMSE comes out pretty reasonable for GOOG. The predicted curve follows the actual price trend quite closely, which was the main goal.
- Add some technical indicators like moving averages or RSI
- Maybe try sentiment from news headlines
- Live data instead of just historical
- Try GRU or transformer based models and compare
Ayan Ghosh JN Institute of Computer and Technology - Master Diploma in Information Technology Edunet Foundation | IBM SkillsBuild | AI Internship, May-June 2026