This project predicts Bitcoin (BTC) prices using a Long Short-Term Memory (LSTM) deep learning model. It fetches real-time Bitcoin price data from the CoinGecko API, processes it, and generates future price predictions through an interactive Streamlit web application.
🔗 Streamlit App URL 👉 https://thehoodguy4587-crypto-price-prediction-app-ytvra1.streamlit.app/
- 📊 Fetches live Bitcoin price data using CoinGecko API
- 🧠 Uses a pre-trained LSTM model for time-series forecasting
- 🔢 Data scaling using MinMaxScaler
- 📈 Visualizes Actual vs Predicted prices
- 🔮 Predicts next-day Bitcoin price
- 🌐 Deployed using Streamlit Community Cloud
- Model Type: LSTM (Long Short-Term Memory)
- Sequence Length: 60 days
- Framework: TensorFlow / Keras
- Saved Format:
.keras - Scaler: Saved using
pickle(scaler.pkl)
📌 The model was trained separately in Google Colab and loaded directly in the Streamlit app for inference (no retraining during deployment).
Crypto-Price-Prediction/
│
├── app.py # Streamlit web app
├── bitcoin_lstm_model.keras # Trained LSTM model
├── scaler.pkl # Saved MinMaxScaler
├── requirements.txt # Python dependencies
├── runtime.txt # Python runtime version
├── Crypto_Price_Prediction.ipynb # Training notebook (Colab)
├── LICENSE
└── README.md
git clone https://github.com/theHoodguy4587/Crypto-Price-prediction.git
cd Crypto-Price-predictionpip install -r requirements.txtstreamlit run app.pyKey libraries used:
streamlittensorflownumpypandasscikit-learnmatplotlibrequests
-
Push your code to GitHub
-
Go to 👉 https://share.streamlit.io
-
Select your repository
-
Set:
- Main file:
app.py - Branch:
main
- Main file:
-
Click Deploy 🚀
- API: CoinGecko
- Endpoint:
https://api.coingecko.com/api/v3/coins/bitcoin/market_chart
- Currency: USD
- Time Range: Last 90 days
- Fetch last 90 days of BTC prices
- Scale prices using saved MinMaxScaler
- Create 60-day rolling sequences
- Predict next price using LSTM
- Inverse transform to original price scale
- 📅 Multi-day forecasting
- 💾 Database storage
- 📉 Technical indicators (RSI, MACD)
- 📊 Candlestick charts
- 🚀 Docker deployment
Senitha Gunathilaka 🎓 Data Science Student 🔗 GitHub: theHoodguy4587
This project is licensed under the MIT License. Feel free to use, modify, and distribute.