Improve the frontend 2

This commit is contained in:
Urtzi Alfaro
2025-10-29 06:58:05 +01:00
parent 858d985c92
commit 36217a2729
98 changed files with 6652 additions and 4230 deletions

View File

@@ -263,10 +263,14 @@ class ModelRepository(TrainingBaseRepository):
average_mape = accuracy_row.average_mape if accuracy_row and accuracy_row.average_mape else 0
total_models_with_metrics = accuracy_row.total_models_with_metrics if accuracy_row else 0
# Convert MAPE to accuracy percentage (lower MAPE = higher accuracy)
# Use 100 - MAPE as a simple conversion, but cap it at reasonable bounds
average_accuracy = max(0, min(100, 100 - float(average_mape))) if average_mape > 0 else 0
# Return None if no models have metrics (no data), rather than 0
if total_models_with_metrics == 0:
average_accuracy = None
else:
average_accuracy = max(0, min(100, 100 - float(average_mape))) if average_mape > 0 else 0
return {
"total_models": total_models,