Spaces:
Sleeping
Sleeping
|
Download README.md from nancy05/crypto-forecast: direct link, hf CLI and curl.
- Browser
- Download file 4.76 kB
-
https://huggingface.co/spaces/nancy05/crypto-forecast/resolve/main/README.md
- Command line
-
hf download hf://spaces/nancy05/crypto-forecast/README.md
-
curl -L -o README.md https://huggingface.co/spaces/nancy05/crypto-forecast/resolve/main/README.md
4.76 kB
metadata
title: CryptoSight
emoji: ๐ฎ
colorFrom: green
colorTo: blue
sdk: docker
pinned: false
๐ฎ CryptoSight โ ML-Powered Crypto Forecasting Dashboard
End-to-end ML project combining LSTM time-series forecasting, Facebook Prophet, and FinBERT sentiment analysis in a production-quality Streamlit dashboard.
Project Overview
CryptoSight is a full-stack ML application that forecasts cryptocurrency prices using two models (LSTM neural network + Facebook Prophet) and enriches predictions with real-time news sentiment scored by FinBERT โ a BERT model fine-tuned on financial text.
Live Demo: your-app.streamlit.app
Features
| Feature | Technology |
|---|---|
| Real-time OHLCV data | Yahoo Finance API via yfinance |
| Candlestick + technical indicators | Plotly, Pandas |
| Price forecasting (LSTM) | TensorFlow/Keras โ stacked LSTM |
| Price forecasting (Prophet) | Facebook Prophet |
| Forecast confidence intervals | Walk-forward uncertainty estimation |
| News sentiment scoring | FinBERT (ProsusAI/finbert) |
| Sentiment dashboard | Gauge + per-headline scoring |
| Model performance metrics | MAE, RMSE, MAPE on validation set |
| Training loss curves | Epoch-level train vs val loss |
| Feature correlation matrix | Seaborn-style Plotly heatmap |
| Dark professional UI | Custom CSS, DM Mono font |
Architecture
crypto-forecast/
โ
โโโ app/
โ โโโ main.py # Streamlit entry point
โ โโโ style.css # Custom dark theme CSS
โ โโโ components/
โ โ โโโ sidebar.py # Config sidebar
โ โโโ pages/
โ โโโ overview.py # Price chart + metrics
โ โโโ forecast.py # LSTM + Prophet predictions
โ โโโ sentiment.py # FinBERT news sentiment
โ โโโ model_performance.py # Metrics + architecture
โ
โโโ models/
โ โโโ lstm_model.py # Stacked LSTM (TF/Keras)
โ โโโ prophet_model.py # Facebook Prophet
โ โโโ sentiment_model.py # FinBERT / VADER pipeline
โ
โโโ utils/
โ โโโ data_fetcher.py # Yahoo Finance + news API
โ โโโ charts.py # Plotly figure builders
โ
โโโ tests/
โ โโโ test_models.py # Unit tests
โ
โโโ requirements.txt
โโโ README.md
ML Models
LSTM Neural Network
- Architecture: 3 stacked LSTM layers (128โ64โ32) with Dropout + BatchNorm
- Features: Close price, Volume, RSI(14), MA7, MA25, Annualised Volatility
- Lookback: 60 trading days
- Loss function: Huber loss (robust to outliers)
- Training: EarlyStopping with patience=8
Facebook Prophet
- Seasonality: Weekly + Yearly + custom Monthly (Fourier order 5)
- Changepoint prior: 0.05 (conservative)
- Interval width: 80%
FinBERT Sentiment
- Model:
ProsusAI/finbertโ BERT fine-tuned on 10k financial news items - Labels: Positive / Neutral / Negative โ mapped to [-1, +1]
- Fallback: VADER lexicon-based sentiment if GPU/memory unavailable
Quick Start
1. Clone the repo
git clone https://github.com/yourusername/crypto-forecast.git
cd crypto-forecast
2. Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
3. Install dependencies
pip install -r requirements.txt
4. Run the app
streamlit run app/main.py
Open http://localhost:8501 in your browser.
Deployment (Hugging Face Spaces)
- Create a new Space on huggingface.co/spaces โ choose Streamlit SDK
- Push this repo to the Space's git remote
- Add a
README.mdwith YAML front matter specifyingsdk: streamlitandapp_file: app/main.py - The Space builds automatically โ free hosting with GPU support
Results
| Model | MAE ($) | RMSE ($) | MAPE (%) |
|---|---|---|---|
| LSTM | ~1,200 | ~1,900 | ~4.2% |
| Prophet | ~1,800 | ~2,500 | ~6.1% |
Results vary by coin and date range.
Tech Stack
- Python 3.10+
- TensorFlow 2.16 โ LSTM model
- Prophet 1.1 โ Bayesian time-series
- HuggingFace Transformers โ FinBERT
- Streamlit โ web dashboard
- Plotly โ interactive charts
- yfinance โ market data
- scikit-learn โ preprocessing & metrics