Add FastAPI backend for energy trading system
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.
This commit is contained in:
16
backend/app/ml/utils/config.py
Normal file
16
backend/app/ml/utils/config.py
Normal file
@@ -0,0 +1,16 @@
|
||||
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"]
|
||||
Reference in New Issue
Block a user