What and why
Model type strings like random_forest, logistic_regression, xgboost currently appear as-is in the evaluation results UI. TrainingPanel and CrossValidationPanel each define their own local label map independently, and the evaluation views (EvaluationPage, EvaluationPanel) display raw API values directly.
What to do
Create frontend/src/lib/modelTypes.ts with a shared formatter:
export const MODEL_LABELS: Record<string, string> = {
xgboost: 'XGBoost',
random_forest: 'Random Forest',
logistic_regression: 'Logistic Regression',
linear_regression: 'Linear Regression',
}
export function formatModelName(raw: string): string {
return MODEL_LABELS[raw] ?? raw
}
Replace the local MODEL_OPTIONS label arrays in TrainingPanel.tsx and CrossValidationPanel.tsx with imports from this file.
Apply formatModelName() wherever best_model or r.model is rendered in EvaluationPage.tsx and EvaluationPanel.tsx.
Acceptance criteria
- Evaluation results show "Random Forest" not "random_forest"
- No duplicate label maps remain in the codebase
- npm run lint and npm run typecheck pass
Good for
Anyone comfortable with TypeScript and React. No backend knowledge needed. Touches ~5 files.
What and why
Model type strings like
random_forest,logistic_regression,xgboostcurrently appear as-is in the evaluation results UI.TrainingPanelandCrossValidationPaneleach define their own local label map independently, and the evaluation views (EvaluationPage,EvaluationPanel) display raw API values directly.What to do
Create
frontend/src/lib/modelTypes.tswith a shared formatter:Replace the local
MODEL_OPTIONSlabel arrays inTrainingPanel.tsxandCrossValidationPanel.tsxwith imports from this file.Apply
formatModelName()whereverbest_modelorr.modelis rendered inEvaluationPage.tsxandEvaluationPanel.tsx.Acceptance criteria
Good for
Anyone comfortable with TypeScript and React. No backend knowledge needed. Touches ~5 files.