Spaces:
Paused
Paused
Delete learning_hub/schemas.py
Browse files- learning_hub/schemas.py +0 -39
learning_hub/schemas.py
DELETED
|
@@ -1,39 +0,0 @@
|
|
| 1 |
-
# learning_hub/schemas.py
|
| 2 |
-
# (V13.0 - Data-Driven Schemas)
|
| 3 |
-
|
| 4 |
-
from pydantic import BaseModel, Field
|
| 5 |
-
from typing import List, Dict, Any, Optional
|
| 6 |
-
from datetime import datetime
|
| 7 |
-
import uuid
|
| 8 |
-
|
| 9 |
-
class TrainingSample(BaseModel):
|
| 10 |
-
"""
|
| 11 |
-
عينة تدريب واحدة تمثل صفقة مكتملة.
|
| 12 |
-
تحتوي على متجه الميزات (Features) والنتيجة (Label).
|
| 13 |
-
"""
|
| 14 |
-
id: str = Field(default_factory=lambda: f"sample_{uuid.uuid4().hex[:8]}")
|
| 15 |
-
timestamp: str = Field(default_factory=lambda: datetime.now().isoformat())
|
| 16 |
-
symbol: str
|
| 17 |
-
|
| 18 |
-
# الميزات التي دخل النموذج بناءً عليها (الأرقام الخام)
|
| 19 |
-
features: List[float] = Field(..., description="Feature vector used for prediction")
|
| 20 |
-
|
| 21 |
-
# النتيجة: 1 (ربح) أو 0 (خسارة)
|
| 22 |
-
label: int = Field(..., description="1 if trade was profitable, 0 otherwise")
|
| 23 |
-
|
| 24 |
-
# معلومات إضافية للفلترة
|
| 25 |
-
model_source: str = Field(..., description="Which model was this? (titan/sniper)")
|
| 26 |
-
confidence_at_entry: float = Field(0.0)
|
| 27 |
-
pnl_percent: float = Field(0.0)
|
| 28 |
-
|
| 29 |
-
class TrainingReport(BaseModel):
|
| 30 |
-
"""
|
| 31 |
-
تقرير نتائج التدريب الذي سيُحفظ في R2
|
| 32 |
-
"""
|
| 33 |
-
timestamp: str = Field(default_factory=lambda: datetime.now().isoformat())
|
| 34 |
-
model_name: str
|
| 35 |
-
samples_count: int
|
| 36 |
-
old_accuracy: float
|
| 37 |
-
new_accuracy: float
|
| 38 |
-
training_status: str # SUCCESS / REJECTED (if new model is worse)
|
| 39 |
-
log_message: str
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|