fix(frontend): update ModelInfoResponse types to match backend structure

- Update TypeScript types to match flat backend response structure
- Remove nested model_info and metrics objects
- Remove label_config, use labels array and per_class_metrics array
- Update all component references to use new structure
- Generate default colors for prediction labels in CandleChart
- Fix TypeScript type errors for nullable model_version
- Remove accuracy/F1 metrics display (not in new response)
This commit is contained in:
Marko Djordjevic 2026-02-15 21:39:38 +01:00
parent aa81d4f3d0
commit 5a7c901980
95 changed files with 326 additions and 63 deletions

View file

@ -16,40 +16,23 @@ export interface PerCandlePrediction {
confidence: number;
}
export interface ModelInfo {
model_name: string;
model_version: string;
model_type: string;
experiment_name: string;
run_id: string;
trained_at: string;
feature_count: number;
label_names: string[];
}
export interface PerClassMetrics {
[label: string]: {
precision: number;
recall: number;
f1_score: number;
support: number;
};
}
export interface ModelMetrics {
accuracy: number;
f1_macro: number;
f1_weighted: number;
per_class: PerClassMetrics;
label: string;
precision: number;
recall: number;
f1_score: number;
support: number;
}
export interface ModelInfoResponse {
model_info: ModelInfo;
metrics: ModelMetrics;
label_config: {
name: string;
color: string;
}[];
model_name: string;
model_version: string | null;
model_type: string;
trained_at: string | null;
dataset_version: string | null;
feature_engineering_enabled: boolean;
labels: string[];
per_class_metrics: PerClassMetrics[];
}
export interface PredictRequest {