Loading repository data…
Loading repository data…
hassan-ali786 / repository
An end-to-end Bitcoin price prediction system built with Machine Learning — featuring technical indicators (MA, RSI, Lag features), a trained Linear Regression model, and an interactive Streamlit dashboard for live predictions.
An end-to-end Machine Learning project that predicts Bitcoin (BTC-USD) closing prices using historical market data, technical indicators, and an interactive Streamlit dashboard.
This project builds a complete ML pipeline for cryptocurrency price prediction — from raw data ingestion and feature engineering to model training, evaluation, and a live interactive UI. The goal is to predict the next Bitcoin closing price using historical OHLCV data combined with technical indicators commonly used in financial analysis. Two models are compared (Linear Regression and Random Forest), with full evaluation metrics and a 7-day iterative forecast.
Predicted Price ± RMSERaw CSV / yfinance → Preprocessing → Feature Engineering → Train/Test Split (shuffle=False) → Model Training → Evaluation → Streamlit UI
| Feature | Description |
|---|---|
| Open, High, Low | Daily OHLC price values |
| Volume | Daily trading volume |
| MA7 | 7-day moving average |
| MA30 | 30-day moving average |
| Lag1, Lag2, Lag3 | Previous 1, 2, 3 day closing prices |
| Returns | Daily percentage return (pct_change) |
| RSI | Relative Strength Index (14-day) |
| Category | Tools |
|---|---|
| Language | Python 3.9+ |
| Data Handling | Pandas, NumPy |
| Live Data | yfinance |
| Modeling | Scikit-learn (LinearRegression, RandomForestRegressor) |
| Visualization | Matplotlib |
| Frontend | Streamlit |
| Serialization | Joblib |
smart-crypto-price-predictor/
│
├── data/
│ └── processed_btc_data.csv # Preprocessed BTC-USD dataset
│
├── notebooks/
│ ├── eda.ipynb # Exploratory Data Analysis
│ ├── features.ipynb # Feature engineering walkthrough
│ └── model.ipynb # Model training & evaluation
│
├── src/
│ ├── preprocess.py # Data cleaning & feature generation
│ ├── train.py # Model training script
│ ├── predict.py # Prediction logic
│ ├── data_loader.py # Data loading utilities
│ └── utils.py # Helper functions
│
├── models/
│ └── model.pkl # Saved trained model
│
├── app/
│ └── app.py # Streamlit frontend
│
├── requirements.txt
└── README.md
# 1. Clone the repo
git clone https://github.com/hassan-ali786/smart-crypto-price-predictor.git
cd smart-crypto-price-predictor
# 2. Install dependencies
pip install -r requirements.txt
# 3. Run the app
streamlit run app/app.py
If
models/model.pklis not present, the app will auto-train from the CSV on first launch.
| Model | MAE | RMSE | MAPE |
|---|---|---|---|
| Linear Regression | ~$1,200 | ~$1,800 | ~3.2% |
| Random Forest | ~$900 | ~$1,400 | ~2.4% |
Results on 20% holdout test set (time-series split, shuffle=False)
This project was developed collaboratively by:
Both contributors worked together on data analysis, machine learning development, implementation, and project integration.