From bfb493baae8078f2d4ab3bbb4c609d279d4c05dd Mon Sep 17 00:00:00 2001 From: Maksym Nechepurenko Date: Thu, 14 May 2026 08:50:22 +0400 Subject: [PATCH] feat(frontend): cumulative Brier in time series chart, top-3 agents only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Brier score in the leaderboard time series was raw per-round, while Alpha was a cumulative weighted average — making the two metrics behave differently on the same chart. Now both use the same running weighted mean (weighted by scored markets) so they converge consistently over distance. Also reduces chart agents from top-5 to top-3 to reduce visual noise. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/pages/LeaderboardPage.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/LeaderboardPage.tsx b/frontend/src/pages/LeaderboardPage.tsx index abb2107..5edde0c 100644 --- a/frontend/src/pages/LeaderboardPage.tsx +++ b/frontend/src/pages/LeaderboardPage.tsx @@ -122,11 +122,14 @@ export default function LeaderboardPage() { }) .sort((a, b) => a.roundId - b.roundId); let weightedSum = 0; + let brierSum = 0; let totalWeight = 0; const series = roundSeriesData.map(r => { weightedSum += r.alpha * r.scored; + brierSum += r.brier * r.scored; totalWeight += r.scored; - return { roundId: r.roundId, cumAlpha: weightedSum / Math.max(1, totalWeight), brier: r.brier, scored: r.scored }; + const w = Math.max(1, totalWeight); + return { roundId: r.roundId, cumAlpha: weightedSum / w, brier: brierSum / w, scored: r.scored }; }); result.push({ @@ -173,7 +176,7 @@ export default function LeaderboardPage() { const { entries, globalMaxAbs, totalRoundsInWindow } = data; const CHART_COLORS = ['var(--fa-chart-1)', 'var(--fa-chart-2)', 'var(--fa-chart-3)', 'var(--fa-chart-4)', 'var(--fa-chart-5)']; - const top5ChartAgents = entries.slice(0, 5).map((a, i) => ({ + const top5ChartAgents = entries.slice(0, 3).map((a, i) => ({ address: a.address, name: a.name || truncAddr(a.address), color: CHART_COLORS[i],