Improve AI logic

This commit is contained in:
Urtzi Alfaro
2025-11-05 13:34:56 +01:00
parent 5c87fbcf48
commit 394ad3aea4
218 changed files with 30627 additions and 7658 deletions

View File

@@ -18,6 +18,7 @@ from .training import (
ModelPerformanceMetric,
TrainingJobQueue,
ModelArtifact,
TrainingPerformanceMetrics,
)
# List all models for easier access
@@ -27,5 +28,6 @@ __all__ = [
"ModelPerformanceMetric",
"TrainingJobQueue",
"ModelArtifact",
"TrainingPerformanceMetrics",
"AuditLog",
]

View File

@@ -150,7 +150,8 @@ class TrainedModel(Base):
hyperparameters = Column(JSON) # Store optimized parameters
features_used = Column(JSON) # List of regressor columns
normalization_params = Column(JSON) # Store feature normalization parameters for consistent predictions
product_category = Column(String, nullable=True) # Product category for category-specific forecasting
# Model status
is_active = Column(Boolean, default=True)
is_production = Column(Boolean, default=False)
@@ -185,6 +186,7 @@ class TrainedModel(Base):
"training_samples": self.training_samples,
"hyperparameters": self.hyperparameters,
"features_used": self.features_used,
"product_category": self.product_category,
"is_active": self.is_active,
"is_production": self.is_production,
"created_at": self.created_at.isoformat() if self.created_at else None,