Fancy-yousa commited on
Commit
b5c01ab
·
verified ·
1 Parent(s): e268078

Delete global.html

Browse files
Files changed (1) hide show
  1. global.html +0 -488
global.html DELETED
@@ -1,488 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Global Leaderboard</title>
7
- <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
8
- <style>
9
- :root {
10
- --primary-color: #8e44ad; /* Purple for global view */
11
- --secondary-color: #2c3e50;
12
- --background-color: #f8f9fa;
13
- --text-color: #333;
14
- --border-color: #dee2e6;
15
- --hover-color: #f1f1f1;
16
- --sidebar-width: 280px;
17
- }
18
-
19
- body {
20
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
21
- margin: 0;
22
- padding: 0;
23
- background-color: var(--background-color);
24
- color: var(--text-color);
25
- display: flex;
26
- min-height: 100vh;
27
- }
28
-
29
- /* Sidebar Styling */
30
- .sidebar {
31
- width: var(--sidebar-width);
32
- background-color: var(--secondary-color);
33
- color: white;
34
- position: fixed;
35
- height: 100vh;
36
- overflow-y: auto;
37
- padding: 20px;
38
- box-sizing: border-box;
39
- left: 0;
40
- top: 0;
41
- z-index: 100;
42
- display: flex;
43
- flex-direction: column;
44
- gap: 20px;
45
- }
46
-
47
- .sidebar h2 {
48
- font-size: 1.2em;
49
- margin-bottom: 10px;
50
- color: #ecf0f1;
51
- border-bottom: 1px solid #34495e;
52
- padding-bottom: 5px;
53
- }
54
-
55
- .nav-links {
56
- list-style: none;
57
- padding: 0;
58
- margin: 0;
59
- }
60
-
61
- .nav-links li a {
62
- display: block;
63
- padding: 10px;
64
- color: #bdc3c7;
65
- text-decoration: none;
66
- border-radius: 4px;
67
- transition: background 0.2s;
68
- }
69
-
70
- .nav-links li a:hover, .nav-links li a.active {
71
- background: rgba(255,255,255,0.1);
72
- color: white;
73
- }
74
-
75
- /* Main Content Styling */
76
- .main-content {
77
- margin-left: var(--sidebar-width);
78
- flex: 1;
79
- padding: 40px;
80
- max-width: calc(100% - var(--sidebar-width));
81
- box-sizing: border-box;
82
- min-width: 0;
83
- }
84
-
85
- .container {
86
- max-width: 1200px;
87
- margin: 0 auto;
88
- background: white;
89
- padding: 20px;
90
- border-radius: 8px;
91
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
92
- }
93
-
94
- header {
95
- display: flex;
96
- justify-content: space-between;
97
- align-items: center;
98
- margin-bottom: 20px;
99
- border-bottom: 2px solid var(--primary-color);
100
- padding-bottom: 10px;
101
- }
102
-
103
- h1 {
104
- margin: 0;
105
- color: var(--secondary-color);
106
- }
107
-
108
- .description-box {
109
- background-color: #e8f4fd;
110
- border-left: 4px solid #3498db;
111
- padding: 15px;
112
- margin-bottom: 20px;
113
- border-radius: 4px;
114
- }
115
-
116
- .description-box h3 {
117
- margin-top: 0;
118
- color: #2980b9;
119
- }
120
-
121
- .description-box p {
122
- margin: 5px 0;
123
- line-height: 1.5;
124
- }
125
-
126
- .weights-control {
127
- background-color: #f1f1f1;
128
- padding: 15px;
129
- border-radius: 8px;
130
- margin-bottom: 20px;
131
- border: 1px solid #ddd;
132
- }
133
-
134
- .weights-control h3 {
135
- margin-top: 0;
136
- margin-bottom: 15px;
137
- font-size: 1.1em;
138
- }
139
-
140
- .sliders-container {
141
- display: flex;
142
- gap: 20px;
143
- flex-wrap: wrap;
144
- align-items: center;
145
- }
146
-
147
- .slider-group {
148
- display: flex;
149
- align-items: center;
150
- gap: 10px;
151
- }
152
-
153
- .slider-group label {
154
- font-weight: bold;
155
- min-width: 60px;
156
- }
157
-
158
- input[type="number"] {
159
- width: 80px;
160
- padding: 5px;
161
- border: 1px solid #ccc;
162
- border-radius: 4px;
163
- }
164
-
165
- input[readonly] {
166
- background-color: #e9ecef;
167
- color: #666;
168
- }
169
-
170
- button.recalc-btn {
171
- background-color: var(--primary-color);
172
- color: white;
173
- border: none;
174
- padding: 8px 20px;
175
- border-radius: 4px;
176
- cursor: pointer;
177
- font-size: 14px;
178
- margin-left: auto;
179
- }
180
-
181
- button.recalc-btn:hover {
182
- opacity: 0.9;
183
- }
184
-
185
- table {
186
- width: 100%;
187
- border-collapse: collapse;
188
- margin-top: 10px;
189
- }
190
-
191
- th, td {
192
- padding: 12px 15px;
193
- text-align: left;
194
- border-bottom: 1px solid var(--border-color);
195
- }
196
-
197
- th {
198
- background-color: var(--secondary-color);
199
- color: white;
200
- cursor: pointer;
201
- user-select: none;
202
- position: sticky;
203
- top: 0;
204
- }
205
-
206
- th:hover {
207
- background-color: #34495e;
208
- }
209
-
210
- th .arrow {
211
- font-size: 10px;
212
- margin-left: 5px;
213
- opacity: 0.7;
214
- }
215
-
216
- tr:hover {
217
- background-color: var(--hover-color);
218
- }
219
-
220
- .score-bar {
221
- height: 6px;
222
- background-color: #e9ecef;
223
- border-radius: 3px;
224
- overflow: hidden;
225
- margin-top: 5px;
226
- }
227
-
228
- .score-fill {
229
- height: 100%;
230
- background-color: var(--primary-color);
231
- }
232
-
233
- .version-tag {
234
- font-size: 0.8em;
235
- color: #7f8c8d;
236
- margin-top: 5px;
237
- }
238
- </style>
239
- </head>
240
- <body>
241
-
242
- <div class="sidebar">
243
- <div style="text-align: center; margin-bottom: 20px;">
244
- <h1 style="font-size: 1.5em; margin: 0; color: white;">AutoFS</h1>
245
- <div style="font-size: 0.8em; color: #bdc3c7;">Feature Selection Leaderboard</div>
246
- </div>
247
-
248
- <div>
249
- <h2>Navigation</h2>
250
- <ul class="nav-links">
251
- <li><a href="/">📊 Overview</a></li>
252
- <li><a href="/#main-table">🏆 Leaderboard</a></li>
253
- <li><a href="/#charts">📈 Charts</a></li>
254
- <li><a href="/#details">ℹ️ Details</a></li>
255
- <li><a href="/global" class="active">🌍 Global Rankings</a></li>
256
- <li><a href="/submit">📤 Submit Data/Method</a></li>
257
- </ul>
258
- </div>
259
-
260
- <div style="margin-top: auto; padding-top: 20px; border-top: 1px solid #34495e;">
261
- <p style="font-size: 0.8em; color: #bdc3c7; text-align: center;">
262
- Need help?<br>
263
- <a href="mailto:support@autofs.com" style="color: var(--primary-color);">Contact Support</a>
264
- </p>
265
- </div>
266
- </div>
267
-
268
- <div class="main-content">
269
- <div class="container">
270
- <header>
271
- <div>
272
- <h1>🌍 Global Algorithm Rankings</h1>
273
- <div id="last-updated" class="version-tag">Data Last Updated: Loading...</div>
274
- </div>
275
- <!-- Removed redundant back link as sidebar handles navigation -->
276
- </header>
277
-
278
- <div class="description-box">
279
- <h3>About Global Rankings</h3>
280
- <p>
281
- This page provides a comprehensive evaluation of feature selection algorithms across all available datasets.
282
- Algorithms are ranked based on a weighted score combining <strong>Accuracy (F1)</strong>, <strong>Robustness (AUC)</strong>, and <strong>Efficiency (Time)</strong>.
283
- You can adjust the importance of each factor below to customize the ranking criteria.
284
- </p>
285
- </div>
286
-
287
- <div class="weights-control">
288
- <h3>🏆 Scoring Formula: S = α·F1 + β·AUC</h3>
289
- <p style="font-size: 0.9em; color: #666; margin-bottom: 10px;">
290
- Constraint: α + β = 1.
291
- </p>
292
-
293
- <div class="sliders-container">
294
- <div class="slider-group">
295
- <label for="weight-a">F1 (α):</label>
296
- <input type="number" id="weight-a" value="0.5" step="0.05" min="0" max="1">
297
- </div>
298
-
299
- <div class="slider-group">
300
- <label for="weight-b">AUC (β):</label>
301
- <input type="number" id="weight-b" value="0.5" readonly title="Auto-calculated: 1 - α">
302
- </div>
303
-
304
- <button class="recalc-btn" onclick="calculateAndRender()">Recalculate Rankings</button>
305
- </div>
306
- </div>
307
-
308
- <div id="loading-indicator" style="text-align: center; color: #666;">Loading global stats...</div>
309
-
310
- <table id="global-table">
311
- <thead>
312
- <tr>
313
- <th data-key="rank">#</th>
314
- <th data-key="algorithm">Algorithm <span class="arrow">↕</span></th>
315
- <th data-key="mean_f1_global">Global F1 <span class="arrow">↕</span></th>
316
- <th data-key="mean_auc_global">Global AUC <span class="arrow">↕</span></th>
317
- <th data-key="final_score">Final Score <span class="arrow">↕</span></th>
318
- </tr>
319
- </thead>
320
- <tbody>
321
- <!-- Data rows -->
322
- </tbody>
323
- </table>
324
- </div>
325
- </div>
326
-
327
- <script>
328
- let rawData = [];
329
- let processedData = [];
330
- let sortKey = 'final_score';
331
- let sortDirection = -1; // Descending by default
332
-
333
- const tableBody = document.querySelector("#global-table tbody");
334
- const weightA = document.getElementById("weight-a");
335
- const weightB = document.getElementById("weight-b");
336
- const lastUpdatedDiv = document.getElementById("last-updated");
337
-
338
- // Fetch datasets info to get latest date
339
- function fetchLastUpdated() {
340
- fetch("/api/datasets")
341
- .then(res => res.json())
342
- .then(data => {
343
- if (data.length > 0) {
344
- // Sort by date to find latest? Or just take one?
345
- // Usually we want the overall latest date.
346
- // Let's just pick the first one's date or find the max date if needed.
347
- // For simplicity, just showing "Latest"
348
- const dates = data.map(d => d.last_updated).filter(d => d !== 'Unknown').sort().reverse();
349
- if (dates.length > 0) {
350
- lastUpdatedDiv.textContent = `Data Last Updated: ${dates[0]}`;
351
- } else {
352
- lastUpdatedDiv.textContent = `Data Last Updated: Unknown`;
353
- }
354
- }
355
- });
356
- }
357
-
358
- function fetchGlobalStats() {
359
- fetch("/api/global_stats")
360
- .then(res => res.json())
361
- .then(data => {
362
- rawData = data;
363
- document.getElementById("loading-indicator").style.display = 'none';
364
- calculateAndRender();
365
- })
366
- .catch(err => {
367
- console.error("Error:", err);
368
- document.getElementById("loading-indicator").textContent = "Error loading data.";
369
- });
370
- }
371
-
372
- // Weight auto-adjustment logic
373
- function updateWeights(changedInput) {
374
- let a = parseFloat(weightA.value) || 0;
375
-
376
- // Clamp inputs to 0-1
377
- if (a < 0) a = 0; if (a > 1) a = 1;
378
-
379
- if (changedInput === 'a') {
380
- let b = 1 - a;
381
- // Update UI
382
- weightA.value = parseFloat(a.toFixed(2));
383
- weightB.value = parseFloat(b.toFixed(2));
384
- }
385
- }
386
-
387
- weightA.addEventListener('input', () => updateWeights('a'));
388
-
389
- function calculateAndRender() {
390
- const a = parseFloat(weightA.value) || 0;
391
- const b = parseFloat(weightB.value) || 0;
392
-
393
- // Process data
394
- processedData = rawData.map(d => {
395
- const score = (a * d.mean_f1_global) + (b * d.mean_auc_global);
396
-
397
- return {
398
- ...d,
399
- final_score: score
400
- };
401
- });
402
-
403
- sortData();
404
- renderTable();
405
- }
406
-
407
- function sortData() {
408
- processedData.sort((x, y) => {
409
- const valX = x[sortKey];
410
- const valY = y[sortKey];
411
-
412
- if (valX < valY) return -1 * sortDirection;
413
- if (valX > valY) return 1 * sortDirection;
414
- return 0;
415
- });
416
- }
417
-
418
- function safeFixed(val, digits=4) {
419
- if (val === undefined || val === null) return 'N/A';
420
- return Number(val).toFixed(digits);
421
- }
422
-
423
- function renderTable() {
424
- tableBody.innerHTML = "";
425
-
426
- if (processedData.length === 0) {
427
- tableBody.innerHTML = '<tr><td colspan="5" style="text-align:center;">No data available</td></tr>';
428
- return;
429
- }
430
-
431
- processedData.forEach((row, index) => {
432
- const tr = document.createElement("tr");
433
-
434
- // Highlight rank 1-3
435
- let rankHtml = index + 1;
436
- if (index === 0) rankHtml = '🥇 1';
437
- if (index === 1) rankHtml = '🥈 2';
438
- if (index === 2) rankHtml = '🥉 3';
439
-
440
- tr.innerHTML = `
441
- <td>${rankHtml}</td>
442
- <td><strong>${row.algorithm}</strong> <span style="font-size:0.8em; color:#999">(${row.datasets_count} datasets)</span></td>
443
- <td>${safeFixed(row.mean_f1_global)}</td>
444
- <td>${safeFixed(row.mean_auc_global)}</td>
445
- <td>
446
- <strong>${safeFixed(row.final_score)}</strong>
447
- <div class="score-bar"><div class="score-fill" style="width: ${Math.min(row.final_score * 100, 100)}%"></div></div>
448
- </td>
449
- `;
450
- tableBody.appendChild(tr);
451
- });
452
-
453
- updateSortArrows();
454
- }
455
-
456
- function updateSortArrows() {
457
- document.querySelectorAll('th .arrow').forEach(span => span.textContent = '↕');
458
- const activeHeader = document.querySelector(`th[data-key="${sortKey}"] .arrow`);
459
- if (activeHeader) activeHeader.textContent = sortDirection === 1 ? '↑' : '↓';
460
- }
461
-
462
- document.querySelectorAll('th[data-key]').forEach(th => {
463
- th.addEventListener('click', () => {
464
- const key = th.dataset.key;
465
- if (sortKey === key) {
466
- sortDirection *= -1;
467
- } else {
468
- sortKey = key;
469
- sortDirection = (key === 'rank') ? 1 : -1;
470
- }
471
- if (key === 'rank') {
472
- sortKey = 'final_score';
473
- sortDirection = -1;
474
- }
475
- sortData();
476
- renderTable();
477
- });
478
- });
479
-
480
- document.addEventListener("DOMContentLoaded", () => {
481
- fetchLastUpdated();
482
- fetchGlobalStats();
483
- });
484
-
485
- </script>
486
-
487
- </body>
488
- </html>