Implements FastAPI backend with ML model support for energy trading, including price prediction models and RL-based battery trading policy. Features dashboard, trading, backtest, and settings API routes with WebSocket support for real-time updates.
17 lines
371 B
Python
17 lines
371 B
Python
from dataclasses import dataclass
|
|
from typing import List, Dict, Any
|
|
|
|
|
|
@dataclass
|
|
class MLConfig:
|
|
enable_gpu: bool = False
|
|
n_jobs: int = 4
|
|
verbose: bool = True
|
|
|
|
@classmethod
|
|
def from_dict(cls, config_dict: Dict[str, Any]) -> "MLConfig":
|
|
return cls(**{k: v for k, v in config_dict.items() if k in cls.__annotations__})
|
|
|
|
|
|
__all__ = ["MLConfig"]
|