File size: 2,248 Bytes
a02aa2e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
"""
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()