Bitcoin Forecasting Dashboard
An interactive Streamlit dashboard built to clean, preprocess, and model daily Bitcoin price movements. Integrates Prophet, SARIMA, and Random Forest regressors alongside technical indicator overlays, backtesting evaluations, and Plotly visualization.
Problem Statement
Cryptocurrency market data is characterized by extreme volatility, high frequency, and missing data points. Predicting future prices requires resampling raw minute-level transaction feeds into clean daily intervals, engineering lag and rolling features, training time-series models, and evaluating them using backtesting splits with prediction confidence intervals.
Solution
Built a modular Python dashboard utilizing Streamlit. Designed a preprocessing pipeline that parses raw CSV files, handles datetime columns, resamples prices to daily intervals, and interpolates missing timestamps. Integrated Prophet (seasonal decomposition), SARIMA (autoregressive forecasting via statsmodels/pmdarima), and Random Forest Regressors (recursive multi-step forecasting with residual variance intervals). Evaluated performance with MAE and RMSE backtesting scores and plotted predictions using dynamic Plotly charts.
Architecture
The dashboard ingests minute-level CSV data or downloads it from Kaggle, aggregates it to daily points, trains selected statistical or machine learning models on a user-defined split, and outputs future projections with Plotly confidence intervals.
Key Features
- ▸Dual data modes: automatic Kaggle download or manual CSV dataset upload
- ▸Time-series preprocessing: daily resampling, time interpolation, and forward/backward filling
- ▸Prophet modeling incorporating weekly/yearly seasonal components and probabilistic intervals
- ▸SARIMA modeling supporting auto-tuning (pmdarima) and manual parameter configurations
- ▸Random Forest Regressor featuring recursive forecasting, lags, and rolling mean windows
- ▸Backtesting evaluation framework tracking Mean Absolute Error (MAE) and Root Mean Squared Error (RMSE)
- ▸Dynamic Plotly visualizations with forecast confidence bands and technical indicators (SMA/EMA)
Challenges
- ⚡Handling massive minute-level transaction datasets without causing memory overload. Solved by writing an on-disk caching layer that aggregates raw datasets to daily frequency before memory loading.
- ⚡Ensuring continuity across missing market intervals. Solved by designing a daily resampler that applies linear time interpolation followed by forward/backward fills.
- ⚡Estimating prediction intervals for non-probabilistic models. Solved by computing the standard deviation of in-sample residuals to construct variance bands for the Random Forest model.
Results & Metrics
Successfully deployed an interactive Streamlit UI for cryptocurrency forecasting
Implemented a complete backtesting framework for model validation
Provided real-time overlays for common technical metrics on interactive price feeds
Lessons Learned
- 💡Prophet is exceptionally suited for capturing long-term trends and weekly cycles, whereas Random Forest excels at short-term momentum shifts using lag attributes.
- 💡Resampling data down to daily intervals provides a more robust indicator of market trend movements compared to modeling raw minute-level transaction feeds.
- 💡Enabling user-configured rolling-mean windows in the interface allows for immediate experimentation with feature engineering.
Case Study Overview
Case Study: Bitcoin Forecasting Dashboard
This project implements an interactive forecasting platform for BTC/USD prices. The application is built to preprocess volatile time-series datasets and run statistical and machine learning models to project future cryptocurrency price bands.
Technical Pipeline & System Flow
The application isolates data preparation, modeling, backtesting, and visualization steps to maintain clean execution states:
┌──────────────────────────────────────────────────────────┐
│ BTC/USD Dataset (Kaggle or CSV) │
└────────────────────────────┬─────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────┐
│ Preprocessing (Daily Resampling, Filling, Sorting) │
└────────────────────────────┬─────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────┐
│ Train/Test Holdout Split & Backtest Setup │
└────────────────────────────┬─────────────────────────────┘
│
┌──────────────────┼──────────────────┐
▼ ▼ ▼
┌──────────────────┐ ┌───────────┐ ┌──────────────────┐
│ Prophet (Weekly/ │ │ SARIMA │ │ Random Forest │
│ Yearly Cycles) │ │ (Auto) │ │ (Lags/Rolling) │
└─────────┬────────┘ └─────┬─────┘ └─────────┬────────┘
│ │ │
└──────────────────┼───────────────────┘
│ (Forecast & Prediction Intervals)
▼
┌──────────────────────────────────────────────────────────┐
│ Evaluation Module (MAE & RMSE Calculation) │
└────────────────────────────┬─────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────┐
│ Plotly Visualization Engine (Forecast Curves & Bands) │
└────────────────────────────┬─────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────┐
│ Streamlit Dashboard Interface │
└──────────────────────────────────────────────────────────┘Core Ingestion & Retrieval Methodology
1. Data Ingestion & Caching
- Automatic Download: The pipeline downloads the BTC/USD transaction history using the Kaggle API and saves it locally.
- Local Caching: The data module caches the processed CSV data in
data/to avoid repeated calls and speed up loading times.
2. Time-Series Preprocessing
- Resampling: Minute-level raw transaction entries are sorted by timestamp and resampled to a daily frequency.
- Missing Value Interpolation: Missing dates in the series are handled using linear time interpolation, combined with forward/backward fills, ensuring a continuous time index.
3. Forecasting Models
- Prophet: Captures market trend lines, weekly, and yearly seasonality. Outputs probabilistic future intervals.
- SARIMA: Runs seasonal autoregressive integrated moving average algorithms using
statsmodels. Supports automated search parameters (pmdarima.auto_arima) and manual parameter overrides. - Random Forest Regressor: Extracts lag features and rolling mean window features. Computes recursive forecasts for future horizons and projects confidence intervals based on in-sample residual dispersion.
4. Interactive Visualizations
- Dynamic Charts: Implements
Plotlyto display interactive charts featuring historic lines, backtest predictions, future forecasts, and confidence bands. - Technical Overlays: Provides toggles to display Simple Moving Average (SMA) and Exponential Moving Average (EMA) indicators directly on the price chart.
Technologies
Links
Related Projects
DeepFM CTR Prediction Pipeline
A PyTorch reproduction of the DeepFM architecture for Click-Through Rate prediction on the 45M-sample Criteo dataset, featuring memory-efficient pipelines and 6 architecture ablation studies.
Wikipedia Biographical Clustering
An end-to-end unsupervised clustering pipeline for Wikipedia biographical text using TF-IDF, Word2Vec, and GMM.