π¦ Crypto Predictive Model β ML Ensemble for Crypto Price Prediction
A production-grade machine learning pipeline for cryptocurrency price prediction using 15 years of Yahoo Finance historical data, engineered for integration with high-frequency trading systems.
π Quick Start
pip install yfinance pandas numpy scikit-learn lightgbm ta torch pyarrow joblib
git clone https://huggingface.co/AcyLa/crypto-predictive-model
cd crypto-predictive-model
python train.py --ticker BTC-USD
python predict.py --ticker BTC-USD
π Architecture
Data (yfinance) β Features (207 indicators) β Labels (multi-horizon) β Ensemble (LightGBM+LSTM) β Prediction API
β
Walk-Forward Backtester (purged CV)
π Components
| Component | Description |
|---|---|
| Data | Downloads up to 15 years of OHLCV from Yahoo Finance (BTC since 2014) |
| Features | 207 causal technical indicators: trend, momentum, volatility, volume, price structure, regime, calendar |
| Labels | Multi-horizon (1d, 3d, 7d, 14d, 30d) regression + classification + triple-barrier |
| Models | Ensemble of LightGBM (gradient boosting) + LSTM with attention pooling |
| Backtest | Walk-forward cross-validation with purging β no look-ahead bias |
| Prediction | Real-time multi-horizon signals with consensus voting |
π§ HFT Integration
from predict import CryptoPredictor
predictor = CryptoPredictor(ticker="BTC-USD")
result = predictor.get_multi_horizon(use_lstm=False) # sub-ms for HFT
print(f"Consensus: {result['consensus']} ({result['consensus_confidence']:.0%})")
See hft_integration.py for a complete trading loop with stop-loss, take-profit, and position management.
| Mode | Latency | Use Case |
|---|---|---|
| LightGBM only | < 1ms | HFT, tick-level |
| LightGBM + LSTM (CPU) | ~6-50ms | Swing trading |
π Files
βββ config.py # All hyperparameters
βββ data_loader.py # Yahoo Finance download
βββ features.py # 207 technical indicators
βββ labels.py # Multi-horizon labels + triple-barrier
βββ models.py # LightGBM + LSTM ensemble
βββ backtest.py # Walk-forward backtesting engine
βββ train.py # Main training pipeline
βββ predict.py # Live prediction API + CLI
βββ hft_integration.py # HFT trading loop example
βββ models/BTC-USD/ # Trained models
β οΈ Disclaimer
Research tool, not financial advice. Always backtest with transaction costs and never risk more than you can afford to lose.
Generated by ML Intern
This model repository was generated by ML Intern, an agent for machine learning research and development on the Hugging Face Hub.
- Try ML Intern: https://smolagents-ml-intern.hf.space
- Source code: https://github.com/huggingface/ml-intern
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "AcyLa/crypto-predictive-model"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
For non-causal architectures, replace AutoModelForCausalLM with the appropriate AutoModel class.
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support