fix streak signal, reweight predictions, and reorder UI

- Fix streak signal: was giving 100% to streak chair after normalization
  (non-streak chairs were 0), now properly distributes probability with
  streak chair getting less as streak grows (actual mean reversion)
- Change recent window from 20 to 50 games
- Reweight signals based on backtest: base_rate 0.15→0.20 (best performer),
  recent 0.10→0.15, streak 0.10→0.05, balance 0.15→0.10
- Move Live Market Sentiment above Signal Breakdown
This commit is contained in:
2026-02-26 10:36:53 +05:00
parent 9762c0f9bf
commit 2c7cd67ab7
2 changed files with 32 additions and 52 deletions

View File

@@ -253,19 +253,8 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-
<div id="impact-content"></div>
</div>
<div class="panel" style="margin-top:8px">
<div class="panel-title">Signal Breakdown</div>
<table class="signal-table" id="signal-table">
<thead><tr><th>Signal</th><th>Weight</th><th>A</th><th>B</th><th>C</th></tr></thead>
<tbody></tbody>
</table>
</div>
</div>
<!-- Live Trends: Whale + Public -->
<div class="section">
<div class="section-title">Live Market Sentiment</div>
<div class="trends-grid">
<!-- Live Trends: Whale + Public -->
<div class="trends-grid" style="margin-top:16px">
<div class="trend-panel">
<div class="panel-title">Whale Trend (Top 5 Bettors)</div>
<div id="whale-trend"><div class="trend-empty">Waiting for bets...</div></div>
@@ -278,7 +267,15 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-
</div>
</div>
<!-- Historical: did crowd pick the winner? -->
<div id="crowd-stats" class="crowd-stats"></div>
<div id="crowd-stats" class="crowd-stats" style="margin-top:12px"></div>
<div class="panel" style="margin-top:12px">
<div class="panel-title">Signal Breakdown</div>
<table class="signal-table" id="signal-table">
<thead><tr><th>Signal</th><th>Weight</th><th>A</th><th>B</th><th>C</th></tr></thead>
<tbody></tbody>
</table>
</div>
</div>
<!-- Last 50 Predictions vs Actual -->
@@ -480,7 +477,7 @@ function renderPrediction(data) {
// Signal table
const tbody = $('signal-table').querySelector('tbody');
const sigNames = {'base_rate':'Base Rate','markov_1':'Markov-1','markov_2':'Markov-2','recent_20':'Recent 20','streak':'Streak','balance':'Balance'};
const sigNames = {'base_rate':'Base Rate','markov_1':'Markov-1','markov_2':'Markov-2','recent_50':'Recent 50','streak':'Streak','balance':'Balance'};
tbody.innerHTML = Object.entries(data.signals).map(([key, sig]) =>
`<tr><td style="text-align:left">${sigNames[key]||key}</td><td>${(sig.weight*100).toFixed(0)}%</td>` +
CHAIRS.map(c => `<td style="color:${CHAIR_COLORS[c]}">${pct(sig.probs[c])}</td>`).join('') + '</tr>'
@@ -1051,7 +1048,7 @@ function renderRunsTest(runs) {
function renderBacktest(bt) {
if (bt.error) { $('backtest-cards').innerHTML = `<div style="color:var(--text2)">${bt.error}</div>`; return; }
const names = {base_rate:'Base Rate',markov_1:'Markov-1',markov_2:'Markov-2',recent_20:'Recent 20',streak:'Streak',balance:'Balance',combined:'Combined'};
const names = {base_rate:'Base Rate',markov_1:'Markov-1',markov_2:'Markov-2',recent_50:'Recent 50',streak:'Streak',balance:'Balance',combined:'Combined'};
$('backtest-cards').innerHTML = Object.entries(bt.accuracy).map(([key, acc]) => {
const fh = bt.full_hits?.[key] ?? '?';
const sh = bt.semi_hits?.[key] ?? '?';
@@ -1062,7 +1059,7 @@ function renderBacktest(bt) {
}).join('');
if (bt.rolling_accuracy) {
const ctx = $('backtest-chart').getContext('2d');
const colors = {base_rate:'#8b8fa3',markov_1:'#3b82f6',markov_2:'#ec4899',recent_20:'#f59e0b',streak:'#10b981',balance:'#f472b6',combined:'#6c5ce7'};
const colors = {base_rate:'#8b8fa3',markov_1:'#3b82f6',markov_2:'#ec4899',recent_50:'#f59e0b',streak:'#10b981',balance:'#f472b6',combined:'#6c5ce7'};
const datasets = Object.entries(bt.rolling_accuracy).map(([key, data]) => ({
label: names[key]||key, data, borderColor: colors[key]||'#fff', backgroundColor: 'transparent',
borderWidth: key === 'combined' ? 3 : 1.5, pointRadius: 0, tension: 0.3,