-
[OPIK-4611] [FE][BE] Aggregate trial results in compare experiments table (#5553)
发布于
2026-03-11 11:08:22 +00:00 - [OPIK-4611] [FE][BE] Aggregate trial results in compare experiments table
When using trial_count > 1 with evaluate(), the compare experiments
table now shows averaged values instead of only the latest trial.Frontend:
- Add trials.ts with aggregation logic (avg, stdDev, type guards)
- VerticallySplitCellWrapper aggregates multiple trial items per experiment
- Duration/Cost cells show "avg" badge with trial values tooltip
- Feedback score cells show ± stdDev and avg badge
- AvgBadge shared component for consistent trial indicator
- Output column header indicates "last trial" since output isn't averaged
- Unit tests for all aggregation functions (21 tests)
Backend:
- Change argMax to avg/avgMap for duration, cost, usage, feedback_scores
in both DatasetItemDAO and DatasetItemVersionDAO to make sorting
consistent with displayed averages
- [OPIK-4611] [FE] Address PR review comments and simplify trial aggregation UI
- Sort trial items by created_at to ensure latest trial is used as base
- Move null filtering from averageNumber to aggregateTrialItems for cleaner types
- Replace AvgBadge with tooltip-only approach showing "Avg of X trials (σ=Y)"
- Use formatNumericData for consistent number formatting
- Fix HeaderStatistic refresh bug where duration showed 0 after reload
- Delete unused AvgBadge component
-
[OPIK-4611] [FE] Memoize trial aggregation in VerticallySplitCellWrapper
-
[OPIK-4611] [FE] Use Map.groupBy for experiment item lookups in VerticallySplitCellWrapper
-
[OPIK-4611] [BE] Add multi-trial sorting tests for avg/avgMap in dataset and versioned endpoints
Add tests that verify sorting by avg() and avgMap() produces correct
order when multiple trials exist per dataset item. Tests are designed
so avg and argMax yield different sort orders, ensuring the SQL change
from argMax to avg/avgMap is properly validated.- DatasetsResourceTest: replace single-trial sorting tests with multi-trial versions
- DatasetVersionResourceTest: add sorting tests for versioned endpoint
- DatasetResourceClient: add sorting parameter overload
- [OPIK-4611] [FE] Replace Map.groupBy with lodash groupBy for browser compatibility
下载附件