Fix fold split toggles and live train toggle visibility - #866
Merged
Conversation
A forecasting run scores no train partition, so the chart's train default asked for fold metrics that were never written.
A forecasting strategy writes no train metrics, so the toggle opened on an empty panel.
The style set only defined nestedCv for a cross-validation session, but getRunType returns it for any run flagged nested. The strategy kind arrives asynchronously, so on the first render of a session with nested runs the key was missing and destructuring undefined took the whole table down. The style is now always defined and the legend does the filtering, with a fallback on the lookup so no row can crash the table over a style.
cristian-tamblay
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The metric charts assumed every evaluation strategy scores a training partition. A forecasting strategy does not: fitting on the training rows and then scoring the model on those same rows would report a fit as a forecast, so
ForecastingHoldoutEvaluationStrategyandForecastingCrossValidationEvaluationStrategywrite validation and test metrics only.Both charts opened on a
TRAINtoggle regardless. The fold chart asked the backend for fold metrics that were never written, and the live chart opened on an empty panel. Neither had any way to know, because the split buttons were hardcoded.Evaluation strategies now report which partitions they score, and both charts build their toggles from that instead of from a fixed list. A third fix rides along, same class of bug: the comparison table assumed every session is cross-validated and crashed on a nested run when it was not.
Type of Change
Check all that apply like this [x]:
Changes (by file)
DashAI/back/evaluation/base_evaluation_strategy.py:get_metadatanow reportsscored_splitsbesidekind, taken from the strategy's ownSCORED_SPLITS. A screen that offers one control per partition reads this rather than assuming all three exist.DashAI/front/src/hooks/useStrategyKind.js: the hook was renamed and widened touseStrategyMetadata, returning the whole metadata object instead of justkind, with the same cross component cache.useStrategyKindstays as a thin wrapper over it, so every existing caller is untouched.DashAI/front/src/components/models/FoldMetricsChart.jsx: theTRAIN/VALIDATIONtoggles are built fromscored_splits, and the selected split starts asnulland resolves to the first partition the strategy actually scores. The fetch is held until the strategy metadata arrives, so no request goes out for metrics that were never written, and the spinner covers that wait.DashAI/front/src/components/models/LiveMetricsChart.jsx: same treatment for theTRAIN/VALIDATION/TESTtoggles. The previous effect only corrected a staleTESTselection; it now keeps the selection on any partition still being offered, which folds in the old behaviour.DashAI/front/src/components/models/ModelComparisonTable.jsx:nestedCvis always defined inrunTypeStylesand the legend does the cross-validation filtering, with a fallback on the row lookup so no run type can crash the table over a missing style.tests/back/evaluation/test_forecasting_strategies.py: asserts each strategy reports the partitions it scores, forecasting strategies naming validation and test, the ordinary ones naming all three.Testing (Optional)
Validationtoggle is offered and it is selected on open. NoTraintoggle, no empty chart, no failed request in the network tab.TrainandValidationare both offered andTrainis still the default, as before.Trainis absent and the panel opens onValidationwith data in it.Teststill appears only once test metrics exist.CV anidadoentry stays out of the legend.