WebashalarForML commited on
Commit
af62da6
·
verified ·
1 Parent(s): e1f28f3

Upload 3 files

Browse files
Files changed (2) hide show
  1. static/css/style.css +58 -10
  2. templates/report.html +92 -111
static/css/style.css CHANGED
@@ -51,9 +51,9 @@ canvas#canvas3d {
51
  position: relative;
52
  z-index: 20;
53
  width: 100%;
54
- max-width: 1200px;
55
  margin: 0 auto;
56
- padding: 1.5rem;
57
  display: flex;
58
  flex-direction: column;
59
  min-height: 100vh;
@@ -83,7 +83,7 @@ nav {
83
 
84
  /* Typography */
85
  header {
86
- margin: 3rem 0;
87
  text-align: left;
88
  }
89
 
@@ -115,14 +115,15 @@ h1 .italic {
115
  background: rgba(255, 255, 255, 0.03);
116
  backdrop-filter: blur(15px);
117
  border: 1px solid rgba(255, 255, 255, 0.05);
118
- padding: clamp(2rem, 5vw, 4rem);
119
- margin: 2rem 0;
120
  width: 100%;
121
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
 
122
  }
123
 
124
  .form-group {
125
- margin-bottom: 2.5rem;
126
  }
127
 
128
  label {
@@ -276,11 +277,34 @@ input[type="file"]:hover::file-selector-button {
276
  .table-wrapper {
277
  width: 100%;
278
  overflow-x: auto;
279
- margin-top: 2rem;
 
280
  background: rgba(255, 255, 255, 0.03);
281
  backdrop-filter: blur(10px);
282
  border: 1px solid rgba(255, 255, 255, 0.08);
283
  border-radius: 4px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  }
285
 
286
  table {
@@ -573,10 +597,34 @@ td {
573
  }
574
  }
575
 
576
- /* Flush Section */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
577
  .flush-section {
578
- margin-top: 3rem;
579
- padding-top: 2rem;
580
  border-top: 1px solid rgba(255, 255, 255, 0.05);
581
  }
582
 
 
51
  position: relative;
52
  z-index: 20;
53
  width: 100%;
54
+ max-width: 1300px;
55
  margin: 0 auto;
56
+ padding: 1rem 2rem;
57
  display: flex;
58
  flex-direction: column;
59
  min-height: 100vh;
 
83
 
84
  /* Typography */
85
  header {
86
+ margin: 1.5rem 0;
87
  text-align: left;
88
  }
89
 
 
115
  background: rgba(255, 255, 255, 0.03);
116
  backdrop-filter: blur(15px);
117
  border: 1px solid rgba(255, 255, 255, 0.05);
118
+ padding: clamp(1.5rem, 3vw, 2.5rem);
119
+ margin: 1rem 0;
120
  width: 100%;
121
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
122
+ border-radius: 8px;
123
  }
124
 
125
  .form-group {
126
+ margin-bottom: 1.5rem;
127
  }
128
 
129
  label {
 
277
  .table-wrapper {
278
  width: 100%;
279
  overflow-x: auto;
280
+ overflow-y: auto;
281
+ max-height: 500px;
282
  background: rgba(255, 255, 255, 0.03);
283
  backdrop-filter: blur(10px);
284
  border: 1px solid rgba(255, 255, 255, 0.08);
285
  border-radius: 4px;
286
+ scrollbar-width: thin;
287
+ scrollbar-color: var(--secondary-color) transparent;
288
+ position: relative;
289
+ mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
290
+ -webkit-mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
291
+ }
292
+
293
+ /* Smart indicating effect: show more contrast on inner content */
294
+ .table-wrapper table {
295
+ position: relative;
296
+ z-index: 1;
297
+ }
298
+
299
+ .table-wrapper::-webkit-scrollbar {
300
+ width: 4px;
301
+ height: 4px;
302
+ }
303
+
304
+ .table-wrapper::-webkit-scrollbar-thumb {
305
+ background: var(--secondary-color);
306
+ border-radius: 10px;
307
+ box-shadow: 0 0 10px var(--secondary-color);
308
  }
309
 
310
  table {
 
597
  }
598
  }
599
 
600
+ /* Dashboard Layout */
601
+ .report-grid {
602
+ display: grid;
603
+ grid-template-columns: 1fr;
604
+ gap: 2rem;
605
+ }
606
+
607
+ @media (min-width: 1100px) {
608
+ .report-grid {
609
+ grid-template-columns: 1fr 400px;
610
+ }
611
+
612
+ .sticky-side {
613
+ position: sticky;
614
+ top: 2rem;
615
+ height: min-content;
616
+ }
617
+ }
618
+
619
+ .scroll-card {
620
+ height: 100%;
621
+ display: flex;
622
+ flex-direction: column;
623
+ }
624
+
625
  .flush-section {
626
+ margin-top: 2rem;
627
+ padding-top: 1.5rem;
628
  border-top: 1px solid rgba(255, 255, 255, 0.05);
629
  }
630
 
templates/report.html CHANGED
@@ -30,122 +30,103 @@
30
  </header>
31
 
32
  {% if metrics %}
33
- <section class="upload-card" style="padding: 2.5rem; border-radius: 8px;">
34
- <p class="label-mini">Performance Summary</p>
35
- <div class="metrics-grid">
36
- <div class="metric-item">
37
- <span class="metric-value">{{ (metrics.accuracy * 100)|round(2) }}%</span>
38
- <span class="metric-label">ACCURACY</span>
39
- <p class="metric-note">Percentage of correct predictions out of total samples.</p>
40
- </div>
41
- <div class="metric-item">
42
- <span class="metric-value">{{ metrics.f1|round(4) }}</span>
43
- <span class="metric-label">WEIGHTED F1</span>
44
- <p class="metric-note">Harmonic mean of precision and recall, weighted by class frequency.</p>
45
- </div>
46
- <div class="metric-item">
47
- <span class="metric-value">{{ metrics.macro_f1|round(4) }}</span>
48
- <span class="metric-label">MACRO F1</span>
49
- <p class="metric-note">Unweighted mean of F1 scores across all classes (highlights imbalance
50
- issues).</p>
51
- </div>
52
- <div class="metric-item">
53
- <span class="metric-value">{{ metrics.precision|round(4) }}</span>
54
- <span class="metric-label">PRECISION</span>
55
- <p class="metric-note">Ability of the classifier not to label a negative sample as positive.</p>
56
- </div>
57
- <div class="metric-item">
58
- <span class="metric-value">{{ metrics.recall|round(4) }}</span>
59
- <span class="metric-label">RECALL</span>
60
- <p class="metric-note">Ability of the classifier to find all positive samples.</p>
61
- </div>
62
- </div>
63
 
64
- <!-- Confusion Matrix -->
65
- <p class="label-mini" style="margin-top: 4rem;">Confusion Matrix (Prediction Stability)</p>
66
- <div class="cm-container">
67
- <table class="cm-table">
68
- <thead>
69
- <tr class="cm-label-row">
70
- <th>Actual \ Pred</th>
71
- {% for label in metrics.confusion_matrix.labels %}
72
- <th>{{ label }}</th>
73
- {% endfor %}
74
- </tr>
75
- </thead>
76
- <tbody>
77
- {% for row_idx in range(metrics.confusion_matrix.matrix|length) %}
78
- <tr>
79
- <td
80
- style="background: rgba(255,255,255,0.03); font-weight: 700; color: var(--secondary-color);">
81
- {{ metrics.confusion_matrix.labels[row_idx] }}
82
- </td>
83
- {% for col_idx in range(metrics.confusion_matrix.matrix[row_idx]|length) %}
84
- {% set val = metrics.confusion_matrix.matrix[row_idx][col_idx] %}
85
- <td
86
- class="cm-value {% if row_idx == col_idx %}cm-match{% endif %} {% if val == 0 %}cm-dimmed{% endif %}">
87
- {{ val }}
88
- </td>
89
- {% endfor %}
90
- </tr>
91
- {% endfor %}
92
- </tbody>
93
- </table>
94
  </div>
95
 
96
- <div class="summary-metrics" style="margin-top: 2.5rem; display: flex; gap: 1.5rem; flex-wrap: wrap;">
97
- <div class="summary-card"
98
- style="background: rgba(168, 85, 247, 0.05); border: 1px solid var(--secondary-color); padding: 1.5rem; flex: 1; min-width: 200px; text-align: center; border-radius: 4px;">
99
- <span class="lbl"
100
- style="font-size: 11px; font-weight: 800; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.1em; display: block; margin-bottom: 0.5rem;">Macro
101
- Avg F1</span>
102
- <span class="val" style="font-size: 3rem; font-weight: 900; color: white;">{{
103
- metrics.macro_f1|round(4) }}</span>
104
- </div>
105
- <div class="summary-card"
106
- style="background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255,255,255,0.1); padding: 1.5rem; flex: 1; min-width: 200px; text-align: center; border-radius: 4px;">
107
- <span class="lbl"
108
- style="font-size: 11px; font-weight: 800; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.1em; display: block; margin-bottom: 0.5rem;">Weighted
109
- Avg F1</span>
110
- <span class="val" style="font-size: 3rem; font-weight: 900; color: white;">{{ metrics.f1|round(4)
111
- }}</span>
112
- </div>
113
- <div class="summary-card"
114
- style="background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255,255,255,0.1); padding: 1.5rem; flex: 1; min-width: 200px; text-align: center; border-radius: 4px;">
115
- <span class="lbl"
116
- style="font-size: 11px; font-weight: 800; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.1em; display: block; margin-bottom: 0.5rem;">Overall
117
- Accuracy</span>
118
- <span class="val" style="font-size: 3rem; font-weight: 900; color: white;">{{ (metrics.accuracy *
119
- 100)|round(2) }}%</span>
120
- </div>
121
- </div>
 
 
 
 
 
 
122
 
123
- <p class="label-mini" style="margin-top: 4rem;">Class-Wise Decomposition</p>
124
- <div class="table-wrapper">
125
- <table>
126
- <thead>
127
- <tr>
128
- <th>Grade Class</th>
129
- <th>Precision</th>
130
- <th>Recall</th>
131
- <th>F1-Score</th>
132
- <th>Support</th>
133
- </tr>
134
- </thead>
135
- <tbody>
136
- {% for item in metrics.class_metrics %}
137
- <tr>
138
- <td style="font-weight: 700; color: var(--secondary-color);">{{ item.label }}</td>
139
- <td>{{ item.precision }}</td>
140
- <td>{{ item.recall }}</td>
141
- <td>{{ item.f1 }}</td>
142
- <td style="opacity: 0.5;">{{ item.support }}</td>
143
- </tr>
144
- {% endfor %}
145
- </tbody>
146
- </table>
147
  </div>
148
- </section>
149
  {% endif %}
150
 
151
  <section class="upload-card" style="margin-top: 4rem; padding: 2.5rem; border-radius: 8px;">
 
30
  </header>
31
 
32
  {% if metrics %}
33
+ <div class="report-grid">
34
+ <div class="scroll-card">
35
+ <section class="upload-card" style="margin: 0; padding: 2rem;">
36
+ <p class="label-mini">Performance Summary</p>
37
+ <div class="metrics-grid">
38
+ <div class="metric-item">
39
+ <span class="metric-value">{{ (metrics.accuracy * 100)|round(2) }}%</span>
40
+ <span class="metric-label">ACCURACY</span>
41
+ <p class="metric-note">Overall correctness.</p>
42
+ </div>
43
+ <div class="metric-item">
44
+ <span class="metric-value">{{ metrics.f1|round(4) }}</span>
45
+ <span class="metric-label">WEIGHTED F1</span>
46
+ <p class="metric-note">Balanced score (weighted).</p>
47
+ </div>
48
+ <div class="metric-item">
49
+ <span class="metric-value">{{ metrics.macro_f1|round(4) }}</span>
50
+ <span class="metric-label">MACRO F1</span>
51
+ <p class="metric-note">Unweighted average score.</p>
52
+ </div>
53
+ </div>
 
 
 
 
 
 
 
 
 
54
 
55
+ <p class="label-mini" style="margin-top: 2rem;">Class-Wise Decomposition</p>
56
+ <div class="table-wrapper" style="max-height: 400px;">
57
+ <table>
58
+ <thead>
59
+ <tr>
60
+ <th>Grade</th>
61
+ <th>Prec.</th>
62
+ <th>Recall</th>
63
+ <th>F1</th>
64
+ <th>Sup.</th>
65
+ </tr>
66
+ </thead>
67
+ <tbody>
68
+ {% for item in metrics.class_metrics %}
69
+ <tr>
70
+ <td style="font-weight: 700; color: var(--secondary-color);">{{ item.label }}</td>
71
+ <td>{{ item.precision }}</td>
72
+ <td>{{ item.recall }}</td>
73
+ <td>{{ item.f1 }}</td>
74
+ <td style="opacity: 0.5;">{{ item.support }}</td>
75
+ </tr>
76
+ {% endfor %}
77
+ </tbody>
78
+ </table>
79
+ </div>
80
+ </section>
 
 
 
 
81
  </div>
82
 
83
+ <div class="sticky-side">
84
+ <section class="upload-card" style="margin: 0; padding: 2rem;">
85
+ <p class="label-mini">Confusion Matrix</p>
86
+ <div class="cm-container" style="margin-top: 1rem;">
87
+ <table class="cm-table" style="width: 100%;">
88
+ <thead>
89
+ <tr class="cm-label-row">
90
+ <th>A\P</th>
91
+ {% for label in metrics.confusion_matrix.labels %}
92
+ <th style="min-width: 30px; padding: 0.5rem;">{{ label }}</th>
93
+ {% endfor %}
94
+ </tr>
95
+ </thead>
96
+ <tbody>
97
+ {% for row_idx in range(metrics.confusion_matrix.matrix|length) %}
98
+ <tr>
99
+ <td
100
+ style="background: rgba(255,255,255,0.03); font-weight: 700; color: var(--secondary-color); padding: 0.5rem;">
101
+ {{ metrics.confusion_matrix.labels[row_idx] }}
102
+ </td>
103
+ {% for col_idx in range(metrics.confusion_matrix.matrix[row_idx]|length) %}
104
+ {% set val = metrics.confusion_matrix.matrix[row_idx][col_idx] %}
105
+ <td class="cm-value {% if row_idx == col_idx %}cm-match{% endif %} {% if val == 0 %}cm-dimmed{% endif %}"
106
+ style="padding: 0.5rem;">
107
+ {{ val }}
108
+ </td>
109
+ {% endfor %}
110
+ </tr>
111
+ {% endfor %}
112
+ </tbody>
113
+ </table>
114
+ </div>
115
 
116
+ <div class="summary-metrics"
117
+ style="margin-top: 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;">
118
+ <div class="summary-card" style="padding: 1rem;">
119
+ <span class="lbl">Macro F1</span>
120
+ <span class="val" style="font-size: 1.5rem;">{{ metrics.macro_f1|round(4) }}</span>
121
+ </div>
122
+ <div class="summary-card" style="padding: 1rem;">
123
+ <span class="lbl">Accuracy</span>
124
+ <span class="val" style="font-size: 1.5rem;">{{ (metrics.accuracy * 100)|round(0) }}%</span>
125
+ </div>
126
+ </div>
127
+ </section>
 
 
 
 
 
 
 
 
 
 
 
 
128
  </div>
129
+ </div>
130
  {% endif %}
131
 
132
  <section class="upload-card" style="margin-top: 4rem; padding: 2.5rem; border-radius: 8px;">