AcyLa's picture
Upload config.py with huggingface_hub
a02aa2e verified
Raw History Blame Contribute Delete
2.25 kB
"""
Configuration for the Crypto Predictive Model Pipeline.
All hyperparameters in one place for easy tuning.
"""
from dataclasses import dataclass, field
from typing import List, Dict
@dataclass
class Config:
# ─── Data ───
tickers: List[str] = field(default_factory=lambda: [
"BTC-USD", "ETH-USD", "BNB-USD", "XRP-USD",
"ADA-USD", "SOL-USD", "DOGE-USD",
])
primary_ticker: str = "BTC-USD"
period: str = "max"
interval: str = "1d"
# ─── Feature Engineering ───
trend_windows: List[int] = field(default_factory=lambda: [7, 14, 21, 50, 100, 200])
momentum_windows: List[int] = field(default_factory=lambda: [7, 14, 21, 28])
volatility_windows: List[int] = field(default_factory=lambda: [7, 14, 21, 30, 60])
volume_windows: List[int] = field(default_factory=lambda: [7, 14, 21, 30])
# ─── Labels / Targets ───
horizons: List[int] = field(default_factory=lambda: [1, 3, 7, 14, 30])
classification_threshold: float = 0.02
# ─── Walk-Forward Backtest ───
train_window: int = 1095
val_window: int = 180
test_window: int = 90
step_size: int = 365
purge_gap: int = 30
# ─── LightGBM ───
lgbm_params: Dict = field(default_factory=lambda: {
"objective": "regression",
"metric": "rmse",
"boosting_type": "gbdt",
"num_leaves": 63,
"learning_rate": 0.01,
"feature_fraction": 0.8,
"bagging_fraction": 0.8,
"bagging_freq": 5,
"verbose": -1,
"min_data_in_leaf": 50,
"lambda_l1": 0.1,
"lambda_l2": 0.1,
"max_depth": -1,
"n_estimators": 500,
"early_stopping_rounds": 50,
})
# ─── LSTM ───
lstm_seq_len: int = 60
lstm_hidden_size: int = 128
lstm_num_layers: int = 2
lstm_dropout: float = 0.2
lstm_learning_rate: float = 0.001
lstm_batch_size: int = 64
lstm_epochs: int = 25
lstm_patience: int = 10
# ─── Ensemble ───
ensemble_weights: List[float] = field(default_factory=lambda: [0.6, 0.4])
# ─── Output ───
model_dir: str = "models"
results_dir: str = "results"
cfg = Config()