Add 2 files
Browse files- index.html +376 -117
- prompts.txt +2 -1
index.html
CHANGED
|
@@ -6,27 +6,27 @@
|
|
| 6 |
<title>Matriz de Confusão</title>
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
|
| 9 |
-
<link href="https://fonts.googleapis.com/css2?family=
|
| 10 |
<style>
|
| 11 |
body {
|
| 12 |
-
background: linear-gradient(135deg, #
|
| 13 |
-
color: #
|
| 14 |
-
font-family: '
|
| 15 |
background-attachment: fixed;
|
| 16 |
}
|
| 17 |
#center {
|
| 18 |
-
@apply max-w-6xl mx-auto p-8 bg-
|
| 19 |
}
|
| 20 |
#title {
|
| 21 |
-
@apply text-5xl font-extrabold text-center mb-2 bg-gradient-to-r from-
|
| 22 |
-
text-shadow: 0 0 15px rgba(
|
| 23 |
}
|
| 24 |
#breadcrumps ol {
|
| 25 |
@apply flex text-sm mb-8 space-x-2 text-gray-300;
|
| 26 |
list-style: none;
|
| 27 |
}
|
| 28 |
#breadcrumps a {
|
| 29 |
-
@apply hover:text-
|
| 30 |
}
|
| 31 |
#breadcrumps a:hover i {
|
| 32 |
@apply text-blue-300;
|
|
@@ -45,49 +45,55 @@
|
|
| 45 |
@apply block mt-2 text-white font-semibold;
|
| 46 |
}
|
| 47 |
input[type="text"] {
|
| 48 |
-
@apply border border-gray-
|
| 49 |
}
|
| 50 |
button {
|
| 51 |
-
@apply mt-6 bg-gradient-to-r from-blue-600 to-
|
| 52 |
}
|
| 53 |
.cf {
|
| 54 |
-
@apply mt-
|
| 55 |
}
|
| 56 |
.cf a {
|
| 57 |
@apply text-blue-300 hover:underline hover:text-blue-200 transition-colors;
|
| 58 |
}
|
| 59 |
.matrix {
|
| 60 |
-
@apply mt-8 w-full border border-
|
| 61 |
-
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.
|
| 62 |
}
|
| 63 |
.matrix th, .matrix td {
|
| 64 |
@apply p-4;
|
| 65 |
}
|
| 66 |
.matrix-header {
|
| 67 |
-
@apply bg-
|
| 68 |
}
|
| 69 |
.matrix-cell {
|
| 70 |
-
@apply text-center font-bold text-
|
| 71 |
transition: all 0.3s ease;
|
| 72 |
}
|
| 73 |
.matrix-cell:hover {
|
| 74 |
-
@apply transform scale-
|
|
|
|
| 75 |
}
|
| 76 |
-
#cell_tp { @apply bg-green-900/
|
| 77 |
-
#cell_fp { @apply bg-yellow-900/
|
| 78 |
-
#cell_tn { @apply bg-blue-900/
|
| 79 |
-
#cell_fn { @apply bg-red-900/
|
| 80 |
.metric-card {
|
| 81 |
-
@apply p-6 bg-gradient-to-b from-gray-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
}
|
| 83 |
.metric-title {
|
| 84 |
@apply font-bold text-blue-300 text-sm uppercase tracking-widest mb-2 opacity-90;
|
| 85 |
}
|
| 86 |
.metric-value {
|
| 87 |
-
@apply text-
|
| 88 |
}
|
| 89 |
.instructions {
|
| 90 |
-
@apply mt-10 p-6 bg-
|
| 91 |
}
|
| 92 |
.instructions h3 {
|
| 93 |
@apply flex items-center font-bold text-white text-lg mb-3;
|
|
@@ -103,84 +109,175 @@
|
|
| 103 |
}
|
| 104 |
.tooltip .tooltiptext {
|
| 105 |
visibility: hidden;
|
| 106 |
-
width:
|
| 107 |
background-color: #1e293b;
|
| 108 |
color: #e2e8f0;
|
| 109 |
text-align: center;
|
| 110 |
-
border-radius:
|
| 111 |
-
padding:
|
| 112 |
position: absolute;
|
| 113 |
-
z-index:
|
| 114 |
bottom: 125%;
|
| 115 |
left: 50%;
|
| 116 |
-
margin-left: -
|
| 117 |
opacity: 0;
|
| 118 |
-
transition: opacity 0.3s;
|
| 119 |
font-size: 14px;
|
| 120 |
border: 1px solid #334155;
|
| 121 |
-
box-shadow: 0
|
|
|
|
| 122 |
}
|
| 123 |
.tooltip .tooltiptext::after {
|
| 124 |
content: "";
|
| 125 |
position: absolute;
|
| 126 |
top: 100%;
|
| 127 |
left: 50%;
|
| 128 |
-
margin-left: -
|
| 129 |
-
border-width:
|
| 130 |
border-style: solid;
|
| 131 |
border-color: #1e293b transparent transparent transparent;
|
| 132 |
}
|
| 133 |
.tooltip:hover .tooltiptext {
|
| 134 |
visibility: visible;
|
| 135 |
opacity: 1;
|
|
|
|
| 136 |
}
|
| 137 |
footer {
|
| 138 |
-
@apply bg-
|
| 139 |
}
|
| 140 |
.fade-in {
|
| 141 |
-
animation: fadeIn 0.
|
| 142 |
}
|
| 143 |
@keyframes fadeIn {
|
| 144 |
-
from { opacity: 0; transform: translateY(
|
| 145 |
to { opacity: 1; transform: translateY(0); }
|
| 146 |
}
|
| 147 |
.form-row {
|
| 148 |
@apply mb-6;
|
| 149 |
}
|
| 150 |
.form-container {
|
| 151 |
-
@apply bg-gradient-to-br from-gray-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
}
|
| 153 |
</style>
|
| 154 |
</head>
|
| 155 |
-
<body class="bg-
|
| 156 |
-
|
| 157 |
<!-- Header -->
|
| 158 |
-
<header class="bg-
|
| 159 |
-
<div class="
|
| 160 |
-
|
| 161 |
-
<
|
| 162 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
</p>
|
|
|
|
|
|
|
|
|
|
| 164 |
</div>
|
| 165 |
</header>
|
| 166 |
|
| 167 |
<!-- Main Content -->
|
| 168 |
-
<div id="center" class="transition-all duration-
|
| 169 |
|
| 170 |
<!-- Breadcrumb -->
|
| 171 |
<div id="breadcrumps" class="mt-6">
|
| 172 |
<ol itemscope itemtype="http://schema.org/BreadcrumbList" class="flex items-center justify-center">
|
| 173 |
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
|
| 174 |
-
<a itemprop="item" href="#" class="flex items-center hover:text-blue-300 transition-colors">
|
| 175 |
-
<
|
| 176 |
-
|
|
|
|
|
|
|
| 177 |
</a>
|
| 178 |
<meta itemprop="position" content="1" />
|
| 179 |
</li>
|
| 180 |
<span class="mx-2 opacity-50"><i class="fas fa-chevron-right"></i></span>
|
| 181 |
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
|
| 182 |
-
<a itemprop="item" href="#" class="flex items-center hover:text-
|
| 183 |
-
<
|
|
|
|
|
|
|
| 184 |
<span itemprop="name">Matriz de Confusão</span>
|
| 185 |
</a>
|
| 186 |
<meta itemprop="position" content="2" />
|
|
@@ -190,80 +287,122 @@
|
|
| 190 |
|
| 191 |
<div class="form-container mt-8">
|
| 192 |
<!-- Confusion Matrix Form -->
|
| 193 |
-
<h2 class="
|
| 194 |
-
<i class="fas fa-edit mr-3"></i>Entrada de Dados
|
| 195 |
</h2>
|
| 196 |
|
| 197 |
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
| 198 |
<!-- True Positive -->
|
| 199 |
<div class="true-positive">
|
| 200 |
-
<
|
| 201 |
-
<
|
| 202 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
</p>
|
| 204 |
-
<label for="confusion_matrix_tp"><i class="fas fa-check-circle text-green-400 mr-2"></i>PV (VERDADEIRO POSITIVO)</label>
|
| 205 |
-
<input type="text" id="confusion_matrix_tp" name="tp" value="70" size="8" spellcheck="false" class="mt-1" />
|
| 206 |
</div>
|
| 207 |
|
| 208 |
<!-- False Positive -->
|
| 209 |
<div class="false-positive">
|
| 210 |
-
<
|
| 211 |
-
<
|
| 212 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
</p>
|
| 214 |
-
<label for="confusion_matrix_fp"><i class="fas fa-exclamation-triangle text-yellow-400 mr-2"></i>FP (FALSO POSITIVO)</label>
|
| 215 |
-
<input type="text" id="confusion_matrix_fp" name="fp" value="5" size="8" spellcheck="false" class="mt-1" />
|
| 216 |
</div>
|
| 217 |
|
| 218 |
<!-- True Negative -->
|
| 219 |
<div class="true-negative">
|
| 220 |
-
<
|
| 221 |
-
<
|
| 222 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 223 |
</p>
|
| 224 |
-
<label for="confusion_matrix_tn"><i class="fas fa-check-circle text-blue-400 mr-2"></i>NV (VERDADEIRO NEGATIVO)</label>
|
| 225 |
-
<input type="text" id="confusion_matrix_tn" name="tn" value="15" size="8" spellcheck="false" class="mt-1" />
|
| 226 |
</div>
|
| 227 |
|
| 228 |
<!-- False Negative -->
|
| 229 |
<div class="false-negative">
|
| 230 |
-
<
|
| 231 |
-
<
|
| 232 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
</p>
|
| 234 |
-
<label for="confusion_matrix_fn"><i class="fas fa-times-circle text-red-400 mr-2"></i>FN (FALSO NEGATIVO)</label>
|
| 235 |
-
<input type="text" id="confusion_matrix_fn" name="fn" value="10" size="8" spellcheck="false" class="mt-1" />
|
| 236 |
</div>
|
| 237 |
</div>
|
| 238 |
|
| 239 |
<!-- Analyze Button -->
|
| 240 |
-
<div class="text-center mt-
|
| 241 |
-
<button type="button" id="analyzeBtn" class="
|
| 242 |
-
<i class="fas fa-
|
|
|
|
|
|
|
| 243 |
</button>
|
| 244 |
</div>
|
| 245 |
|
| 246 |
<!-- Related Tools -->
|
| 247 |
-
<div class="cf mt-8 text-center">
|
| 248 |
-
<span class="opacity-80">
|
| 249 |
-
<
|
| 250 |
-
<
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
</div>
|
| 257 |
</div>
|
| 258 |
|
| 259 |
<!-- Confusion Matrix Display -->
|
| 260 |
<div id="matrixContainer" class="mt-12 hidden fade-in">
|
| 261 |
-
<h3 class="text-
|
| 262 |
-
<i class="fas fa-th-large mr-3"></i>Matriz de Confusão
|
| 263 |
</h3>
|
| 264 |
<div class="flex justify-center">
|
| 265 |
<table class="matrix text-white text-center min-w-full max-w-2xl">
|
| 266 |
-
<thead class="bg-gradient-to-r from-gray-
|
| 267 |
<tr>
|
| 268 |
<th class="matrix-header" style="width: 25%;"></th>
|
| 269 |
<th class="matrix-header" style="width: 37.5%;">Previsto: SIM</th>
|
|
@@ -271,15 +410,15 @@
|
|
| 271 |
</tr>
|
| 272 |
</thead>
|
| 273 |
<tbody>
|
| 274 |
-
<tr
|
| 275 |
<td class="matrix-header">Real: SIM</td>
|
| 276 |
-
<td id="cell_tp" class="matrix-cell text-
|
| 277 |
-
<td id="cell_fn" class="matrix-cell text-
|
| 278 |
</tr>
|
| 279 |
-
<tr
|
| 280 |
<td class="matrix-header">Real: NÃO</td>
|
| 281 |
-
<td id="cell_fp" class="matrix-cell text-
|
| 282 |
-
<td id="cell_tn" class="matrix-cell text-
|
| 283 |
</tr>
|
| 284 |
</tbody>
|
| 285 |
</table>
|
|
@@ -288,46 +427,93 @@
|
|
| 288 |
|
| 289 |
<!-- Metrics Display -->
|
| 290 |
<div id="metricsContainer" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mt-12 hidden fade-in">
|
| 291 |
-
<div class="tooltip metric-card">
|
| 292 |
-
<div class="metric-title">
|
| 293 |
<div id="accuracy" class="metric-value">--</div>
|
| 294 |
-
<div class="tooltiptext">Proporção de
|
| 295 |
</div>
|
| 296 |
-
<div class="tooltip metric-card">
|
| 297 |
-
<div class="metric-title">
|
| 298 |
<div id="precision" class="metric-value">--</div>
|
| 299 |
-
<div class="tooltiptext">
|
| 300 |
</div>
|
| 301 |
-
<div class="tooltip metric-card">
|
| 302 |
-
<div class="metric-title">
|
| 303 |
<div id="recall" class="metric-value">--</div>
|
| 304 |
-
<div class="tooltiptext">Capacidade de
|
| 305 |
</div>
|
| 306 |
-
<div class="tooltip metric-card">
|
| 307 |
-
<div class="metric-title">
|
| 308 |
<div id="specificity" class="metric-value">--</div>
|
| 309 |
-
<div class="tooltiptext">Capacidade de
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 310 |
</div>
|
| 311 |
</div>
|
| 312 |
|
| 313 |
<!-- Instructions -->
|
| 314 |
<div class="instructions mt-14">
|
| 315 |
-
<h3><i class="fas fa-lightbulb mr-3"></i>
|
| 316 |
<ul>
|
| 317 |
-
<li><strong>PV (Positivo Verdadeiro):</strong>
|
| 318 |
-
<li><strong>FP (Falso Positivo):</strong>
|
| 319 |
-
<li><strong>NV (Negativo Verdadeiro):</strong>
|
| 320 |
-
<li><strong>FN (Falso Negativo):</strong>
|
| 321 |
</ul>
|
| 322 |
-
<p>Após preencher os valores, clique em <strong class="text-blue-300">"
|
| 323 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
| 324 |
</div>
|
| 325 |
|
| 326 |
</div>
|
| 327 |
|
| 328 |
<!-- Footer -->
|
| 329 |
-
<footer class="mt-
|
| 330 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 331 |
</footer>
|
| 332 |
|
| 333 |
<script>
|
|
@@ -347,14 +533,17 @@
|
|
| 347 |
// Show matrix and metrics with fade-in effect
|
| 348 |
const matrixContainer = document.getElementById('matrixContainer');
|
| 349 |
const metricsContainer = document.getElementById('metricsContainer');
|
|
|
|
|
|
|
| 350 |
matrixContainer.classList.remove('hidden');
|
| 351 |
metricsContainer.classList.remove('hidden');
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
// Force reflow to restart animation
|
| 356 |
void matrixContainer.offsetWidth;
|
| 357 |
-
|
|
|
|
|
|
|
| 358 |
|
| 359 |
// Calculate metrics
|
| 360 |
const total = tp + fp + tn + fn;
|
|
@@ -368,6 +557,76 @@
|
|
| 368 |
document.getElementById('precision').textContent = precision.toFixed(3);
|
| 369 |
document.getElementById('recall').textContent = recall.toFixed(3);
|
| 370 |
document.getElementById('specificity').textContent = specificity.toFixed(3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 371 |
});
|
| 372 |
</script>
|
| 373 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-qwensite.hf.space/logo.svg" alt="qwensite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-qwensite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >QwenSite</a> - 🧬 <a href="https://enzostvs-qwensite.hf.space?remix=alexandremoraisdarosa/matriz-confusao" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
|
|
|
| 6 |
<title>Matriz de Confusão</title>
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
|
| 9 |
+
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
| 10 |
<style>
|
| 11 |
body {
|
| 12 |
+
background: linear-gradient(135deg, #1a1a1a 0%, #2d3748 100%);
|
| 13 |
+
color: #e2e8f0;
|
| 14 |
+
font-family: 'Poppins', sans-serif;
|
| 15 |
background-attachment: fixed;
|
| 16 |
}
|
| 17 |
#center {
|
| 18 |
+
@apply max-w-6xl mx-auto p-8 bg-gradient-to-br from-gray-800/40 to-gray-900/40 backdrop-blur-lg rounded-2xl shadow-2xl text-white mt-10 border border-gray-600/30;
|
| 19 |
}
|
| 20 |
#title {
|
| 21 |
+
@apply text-5xl font-extrabold text-center mb-2 bg-gradient-to-r from-blue-100 to-purple-100 bg-clip-text text-transparent;
|
| 22 |
+
text-shadow: 0 0 15px rgba(147, 197, 253, 0.2);
|
| 23 |
}
|
| 24 |
#breadcrumps ol {
|
| 25 |
@apply flex text-sm mb-8 space-x-2 text-gray-300;
|
| 26 |
list-style: none;
|
| 27 |
}
|
| 28 |
#breadcrumps a {
|
| 29 |
+
@apply hover:text-blue-300 transition-all duration-300 flex items-center;
|
| 30 |
}
|
| 31 |
#breadcrumps a:hover i {
|
| 32 |
@apply text-blue-300;
|
|
|
|
| 45 |
@apply block mt-2 text-white font-semibold;
|
| 46 |
}
|
| 47 |
input[type="text"] {
|
| 48 |
+
@apply border border-gray-500 rounded-lg px-4 py-2 bg-gray-700/70 text-white focus:outline-none focus:ring-4 focus:ring-blue-500/50 transition-all duration-200 w-full shadow-inner;
|
| 49 |
}
|
| 50 |
button {
|
| 51 |
+
@apply mt-6 bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-white font-bold py-4 px-10 rounded-2xl transition-all duration-300 shadow-lg hover:shadow-xl transform hover:scale-105 flex justify-center items-center gap-2;
|
| 52 |
}
|
| 53 |
.cf {
|
| 54 |
+
@apply mt-8 text-sm text-gray-400;
|
| 55 |
}
|
| 56 |
.cf a {
|
| 57 |
@apply text-blue-300 hover:underline hover:text-blue-200 transition-colors;
|
| 58 |
}
|
| 59 |
.matrix {
|
| 60 |
+
@apply mt-8 w-full border border-gray-600 rounded-lg overflow-hidden;
|
| 61 |
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
|
| 62 |
}
|
| 63 |
.matrix th, .matrix td {
|
| 64 |
@apply p-4;
|
| 65 |
}
|
| 66 |
.matrix-header {
|
| 67 |
+
@apply bg-gradient-to-r from-gray-700 to-gray-800 text-white text-center font-bold text-base uppercase tracking-wider;
|
| 68 |
}
|
| 69 |
.matrix-cell {
|
| 70 |
+
@apply text-center font-bold text-2xl relative transition-all duration-300;
|
| 71 |
transition: all 0.3s ease;
|
| 72 |
}
|
| 73 |
.matrix-cell:hover {
|
| 74 |
+
@apply transform scale-110 z-10 cursor-pointer;
|
| 75 |
+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
|
| 76 |
}
|
| 77 |
+
#cell_tp { @apply bg-gradient-to-br from-green-700/80 to-green-900/80 text-green-50 border-r border-b border-green-500/30; }
|
| 78 |
+
#cell_fp { @apply bg-gradient-to-br from-yellow-700/80 to-yellow-900/80 text-yellow-50 border-l border-b border-yellow-500/30; }
|
| 79 |
+
#cell_tn { @apply bg-gradient-to-br from-blue-700/80 to-blue-900/80 text-blue-50 border-l border-t border-blue-500/30; }
|
| 80 |
+
#cell_fn { @apply bg-gradient-to-br from-red-700/80 to-red-900/80 text-red-50 border-r border-t border-red-500/30; }
|
| 81 |
.metric-card {
|
| 82 |
+
@apply p-6 bg-gradient-to-b from-gray-800/70 to-gray-900/70 backdrop-blur-sm rounded-xl shadow-lg border border-gray-600/30 text-center transition-all duration-300 hover:shadow-xl hover:scale-105 relative overflow-hidden;
|
| 83 |
+
}
|
| 84 |
+
.metric-card::before {
|
| 85 |
+
content: '';
|
| 86 |
+
@apply absolute inset-0 rounded-xl opacity-0 hover:opacity-10 transition-opacity duration-300;
|
| 87 |
+
background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
|
| 88 |
}
|
| 89 |
.metric-title {
|
| 90 |
@apply font-bold text-blue-300 text-sm uppercase tracking-widest mb-2 opacity-90;
|
| 91 |
}
|
| 92 |
.metric-value {
|
| 93 |
+
@apply text-4xl md:text-5xl font-extrabold bg-gradient-to-r from-white to-gray-300 bg-clip-text text-transparent;
|
| 94 |
}
|
| 95 |
.instructions {
|
| 96 |
+
@apply mt-10 p-6 bg-gray-800/40 rounded-xl text-gray-200 text-sm leading-relaxed border border-gray-600/30;
|
| 97 |
}
|
| 98 |
.instructions h3 {
|
| 99 |
@apply flex items-center font-bold text-white text-lg mb-3;
|
|
|
|
| 109 |
}
|
| 110 |
.tooltip .tooltiptext {
|
| 111 |
visibility: hidden;
|
| 112 |
+
width: 250px;
|
| 113 |
background-color: #1e293b;
|
| 114 |
color: #e2e8f0;
|
| 115 |
text-align: center;
|
| 116 |
+
border-radius: 10px;
|
| 117 |
+
padding: 12px;
|
| 118 |
position: absolute;
|
| 119 |
+
z-index: 10;
|
| 120 |
bottom: 125%;
|
| 121 |
left: 50%;
|
| 122 |
+
margin-left: -125px;
|
| 123 |
opacity: 0;
|
| 124 |
+
transition: opacity 0.3s, transform 0.3s;
|
| 125 |
font-size: 14px;
|
| 126 |
border: 1px solid #334155;
|
| 127 |
+
box-shadow: 0 8px 25px rgba(0,0,0,0.3);
|
| 128 |
+
backdrop-filter: blur(10px);
|
| 129 |
}
|
| 130 |
.tooltip .tooltiptext::after {
|
| 131 |
content: "";
|
| 132 |
position: absolute;
|
| 133 |
top: 100%;
|
| 134 |
left: 50%;
|
| 135 |
+
margin-left: -7px;
|
| 136 |
+
border-width: 7px;
|
| 137 |
border-style: solid;
|
| 138 |
border-color: #1e293b transparent transparent transparent;
|
| 139 |
}
|
| 140 |
.tooltip:hover .tooltiptext {
|
| 141 |
visibility: visible;
|
| 142 |
opacity: 1;
|
| 143 |
+
transform: translateY(-5px);
|
| 144 |
}
|
| 145 |
footer {
|
| 146 |
+
@apply bg-gray-800/40 backdrop-blur-sm text-gray-400 py-8 text-center text-sm mt-16 border-t border-gray-600/30;
|
| 147 |
}
|
| 148 |
.fade-in {
|
| 149 |
+
animation: fadeIn 0.8s ease-out;
|
| 150 |
}
|
| 151 |
@keyframes fadeIn {
|
| 152 |
+
from { opacity: 0; transform: translateY(20px); }
|
| 153 |
to { opacity: 1; transform: translateY(0); }
|
| 154 |
}
|
| 155 |
.form-row {
|
| 156 |
@apply mb-6;
|
| 157 |
}
|
| 158 |
.form-container {
|
| 159 |
+
@apply bg-gradient-to-br from-gray-800/50 to-gray-900/50 p-8 rounded-2xl shadow-xl border border-gray-700/40;
|
| 160 |
+
}
|
| 161 |
+
.header-img {
|
| 162 |
+
@apply w-full max-w-md mx-auto mb-6 rounded-xl overflow-hidden shadow-2xl;
|
| 163 |
+
}
|
| 164 |
+
.header-img img {
|
| 165 |
+
@apply w-full h-auto;
|
| 166 |
+
}
|
| 167 |
+
.card-glow {
|
| 168 |
+
@apply relative;
|
| 169 |
+
}
|
| 170 |
+
.card-glow::after {
|
| 171 |
+
content: '';
|
| 172 |
+
@apply absolute inset-0 rounded-xl opacity-0 group-hover:opacity-100 transition-opacity duration-500 blur-xl;
|
| 173 |
+
background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
|
| 174 |
+
}
|
| 175 |
+
.metric-card:hover .metric-value {
|
| 176 |
+
@apply scale-105 transition-transform duration-300;
|
| 177 |
+
}
|
| 178 |
+
.input-group {
|
| 179 |
+
@apply relative mb-6;
|
| 180 |
+
}
|
| 181 |
+
.input-group label {
|
| 182 |
+
@apply absolute -top-2 left-3 bg-gray-800/50 px-2 text-xs font-medium text-blue-300 z-10 rounded-full;
|
| 183 |
+
}
|
| 184 |
+
.input-group input {
|
| 185 |
+
@apply rounded-xl;
|
| 186 |
+
}
|
| 187 |
+
/* Enhanced table styling */
|
| 188 |
+
.matrix thead th:first-child {
|
| 189 |
+
@apply rounded-tl-lg;
|
| 190 |
+
}
|
| 191 |
+
.matrix thead th:last-child {
|
| 192 |
+
@apply rounded-tr-lg;
|
| 193 |
+
}
|
| 194 |
+
.matrix tbody td:first-child {
|
| 195 |
+
@apply font-semibold;
|
| 196 |
+
}
|
| 197 |
+
.matrix tr:first-child td {
|
| 198 |
+
@apply border-t-0;
|
| 199 |
+
}
|
| 200 |
+
.matrix tr td {
|
| 201 |
+
@apply border-t border-gray-600/30;
|
| 202 |
+
}
|
| 203 |
+
.matrix tr:first-child td:first-child {
|
| 204 |
+
@apply rounded-tl-none;
|
| 205 |
+
}
|
| 206 |
+
/* Hover effects for table cells */
|
| 207 |
+
#cell_tp:hover { background: linear-gradient(135deg, #166534, #15803d); }
|
| 208 |
+
#cell_fp:hover { background: linear-gradient(135deg, #7c2d12, #92400e); }
|
| 209 |
+
#cell_tn:hover { background: linear-gradient(135deg, #1e3a8a, #1e40af); }
|
| 210 |
+
#cell_fn:hover { background: linear-gradient(135deg, #7f1d1d, #991b1b); }
|
| 211 |
+
|
| 212 |
+
/* Floating elements */
|
| 213 |
+
.floating {
|
| 214 |
+
animation: float 3s ease-in-out infinite;
|
| 215 |
+
}
|
| 216 |
+
@keyframes float {
|
| 217 |
+
0% { transform: translateY(0px) rotate(0deg); }
|
| 218 |
+
50% { transform: translateY(-10px) rotate(1deg); }
|
| 219 |
+
100% { transform: translateY(0px) rotate(0deg); }
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
/* Custom scrollbar */
|
| 223 |
+
::-webkit-scrollbar {
|
| 224 |
+
width: 10px;
|
| 225 |
+
}
|
| 226 |
+
::-webkit-scrollbar-track {
|
| 227 |
+
background: #1a1a1a;
|
| 228 |
+
}
|
| 229 |
+
::-webkit-scrollbar-thumb {
|
| 230 |
+
background: #4a5568;
|
| 231 |
+
border-radius: 10px;
|
| 232 |
+
}
|
| 233 |
+
::-webkit-scrollbar-thumb:hover {
|
| 234 |
+
background: #67728c;
|
| 235 |
}
|
| 236 |
</style>
|
| 237 |
</head>
|
| 238 |
+
<body class="bg-gray-900 text-gray-100 min-h-screen">
|
|
|
|
| 239 |
<!-- Header -->
|
| 240 |
+
<header class="bg-gradient-to-r from-gray-900/90 to-gray-800/90 backdrop-blur-sm text-white py-12 shadow-2xl relative overflow-hidden">
|
| 241 |
+
<div class="absolute inset-0 bg-gradient-to-r from-blue-900/5 to-purple-900/5"></div>
|
| 242 |
+
<div class="container mx-auto text-center relative z-10">
|
| 243 |
+
<div class="flex justify-center mb-4 floating">
|
| 244 |
+
<div class="w-20 h-20 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center shadow-2xl">
|
| 245 |
+
<i class="fas fa-project-diagram text-4xl text-white"></i>
|
| 246 |
+
</div>
|
| 247 |
+
</div>
|
| 248 |
+
<h1 class="text-5xl font-bold bg-gradient-to-r from-blue-100 via-purple-100 to-blue-100 bg-clip-text text-transparent mb-4">
|
| 249 |
+
Matriz de Confusão
|
| 250 |
+
</h1>
|
| 251 |
+
<p class="mt-3 text-blue-100/80 text-lg max-w-4xl mx-auto leading-relaxed px-4">
|
| 252 |
+
Analise com precisão o desempenho do seu modelo de classificação. Insira os valores e obtenha métricas essenciais com visualização intuitiva e inteligente.
|
| 253 |
</p>
|
| 254 |
+
<div class="mt-6 bg-gradient-to-r from-blue-600/20 to-purple-600/20 backdrop-blur-sm max-w-md mx-auto py-3 px-6 rounded-full text-sm font-medium text-blue-100/90 border border-blue-500/20">
|
| 255 |
+
<i class="fas fa-info-circle mr-2"></i> Ferramenta essencial para cientistas de dados e entusiastas de Machine Learning
|
| 256 |
+
</div>
|
| 257 |
</div>
|
| 258 |
</header>
|
| 259 |
|
| 260 |
<!-- Main Content -->
|
| 261 |
+
<div id="center" class="transition-all duration-700 ease-in-out">
|
| 262 |
|
| 263 |
<!-- Breadcrumb -->
|
| 264 |
<div id="breadcrumps" class="mt-6">
|
| 265 |
<ol itemscope itemtype="http://schema.org/BreadcrumbList" class="flex items-center justify-center">
|
| 266 |
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
|
| 267 |
+
<a itemprop="item" href="#" class="flex items-center hover:text-blue-300 transition-colors group">
|
| 268 |
+
<span class="w-6 h-6 bg-blue-600/30 rounded-full flex items-center justify-center mr-2 group-hover:bg-blue-600/50 transition-colors">
|
| 269 |
+
<i class="fas fa-database text-xs text-blue-300"></i>
|
| 270 |
+
</span>
|
| 271 |
+
<span itemprop="name">Análise de Dados</span>
|
| 272 |
</a>
|
| 273 |
<meta itemprop="position" content="1" />
|
| 274 |
</li>
|
| 275 |
<span class="mx-2 opacity-50"><i class="fas fa-chevron-right"></i></span>
|
| 276 |
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
|
| 277 |
+
<a itemprop="item" href="#" class="flex items-center hover:text-purple-300 transition-colors group">
|
| 278 |
+
<span class="w-6 h-6 bg-purple-600/30 rounded-full flex items-center justify-center mr-2 group-hover:bg-purple-600/50 transition-colors">
|
| 279 |
+
<i class="fas fa-project-diagram text-xs text-purple-300"></i>
|
| 280 |
+
</span>
|
| 281 |
<span itemprop="name">Matriz de Confusão</span>
|
| 282 |
</a>
|
| 283 |
<meta itemprop="position" content="2" />
|
|
|
|
| 287 |
|
| 288 |
<div class="form-container mt-8">
|
| 289 |
<!-- Confusion Matrix Form -->
|
| 290 |
+
<h2 class="text-3xl font-bold text-center bg-gradient-to-r from-blue-100 to-purple-100 bg-clip-text text-transparent mb-8 flex items-center justify-center">
|
| 291 |
+
<i class="fas fa-edit mr-3 text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-purple-400"></i>Entrada de Dados
|
| 292 |
</h2>
|
| 293 |
|
| 294 |
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
| 295 |
<!-- True Positive -->
|
| 296 |
<div class="true-positive">
|
| 297 |
+
<div class="input-group">
|
| 298 |
+
<label for="confusion_matrix_tp">Positivo Verdadeiro (PV)</label>
|
| 299 |
+
<div class="relative">
|
| 300 |
+
<div class="absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none">
|
| 301 |
+
<i class="fas fa-check-circle text-green-400"></i>
|
| 302 |
+
</div>
|
| 303 |
+
<input type="text" id="confusion_matrix_tp" name="tp" value="70"
|
| 304 |
+
class="pl-12 pr-4 py-3 bg-gray-700/80 border border-gray-500 rounded-xl focus:ring-4 focus:ring-green-500/30 transition-all duration-200 w-full"
|
| 305 |
+
spellcheck="false" />
|
| 306 |
+
</div>
|
| 307 |
+
</div>
|
| 308 |
+
<p class="info mt-2 ml-2">
|
| 309 |
+
<i class="fas fa-info-circle"></i>
|
| 310 |
+
<span><strong>PV (Positivo Verdadeiro):</strong> casos corretamente identificados como positivos.</span>
|
| 311 |
</p>
|
|
|
|
|
|
|
| 312 |
</div>
|
| 313 |
|
| 314 |
<!-- False Positive -->
|
| 315 |
<div class="false-positive">
|
| 316 |
+
<div class="input-group">
|
| 317 |
+
<label for="confusion_matrix_fp">Falso Positivo (FP)</label>
|
| 318 |
+
<div class="relative">
|
| 319 |
+
<div class="absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none">
|
| 320 |
+
<i class="fas fa-exclamation-triangle text-yellow-400"></i>
|
| 321 |
+
</div>
|
| 322 |
+
<input type="text" id="confusion_matrix_fp" name="fp" value="5"
|
| 323 |
+
class="pl-12 pr-4 py-3 bg-gray-700/80 border border-gray-500 rounded-xl focus:ring-4 focus:ring-yellow-500/30 transition-all duration-200 w-full"
|
| 324 |
+
spellcheck="false" />
|
| 325 |
+
</div>
|
| 326 |
+
</div>
|
| 327 |
+
<p class="info mt-2 ml-2">
|
| 328 |
+
<i class="fas fa-info-circle"></i>
|
| 329 |
+
<span><strong>FP (Falso Positivo):</strong> casos negativos erroneamente classificados como positivos (Erro Tipo I).</span>
|
| 330 |
</p>
|
|
|
|
|
|
|
| 331 |
</div>
|
| 332 |
|
| 333 |
<!-- True Negative -->
|
| 334 |
<div class="true-negative">
|
| 335 |
+
<div class="input-group">
|
| 336 |
+
<label for="confusion_matrix_tn">Negativo Verdadeiro (NV)</label>
|
| 337 |
+
<div class="relative">
|
| 338 |
+
<div class="absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none">
|
| 339 |
+
<i class="fas fa-check-circle text-blue-400"></i>
|
| 340 |
+
</div>
|
| 341 |
+
<input type="text" id="confusion_matrix_tn" name="tn" value="15"
|
| 342 |
+
class="pl-12 pr-4 py-3 bg-gray-700/80 border border-gray-500 rounded-xl focus:ring-4 focus:ring-blue-500/30 transition-all duration-200 w-full"
|
| 343 |
+
spellcheck="false" />
|
| 344 |
+
</div>
|
| 345 |
+
</div>
|
| 346 |
+
<p class="info mt-2 ml-2">
|
| 347 |
+
<i class="fas fa-info-circle"></i>
|
| 348 |
+
<span><strong>NV (Negativo Verdadeiro):</strong> casos corretamente identificados como negativos.</span>
|
| 349 |
</p>
|
|
|
|
|
|
|
| 350 |
</div>
|
| 351 |
|
| 352 |
<!-- False Negative -->
|
| 353 |
<div class="false-negative">
|
| 354 |
+
<div class="input-group">
|
| 355 |
+
<label for="confusion_matrix_fn">Falso Negativo (FN)</label>
|
| 356 |
+
<div class="relative">
|
| 357 |
+
<div class="absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none">
|
| 358 |
+
<i class="fas fa-times-circle text-red-400"></i>
|
| 359 |
+
</div>
|
| 360 |
+
<input type="text" id="confusion_matrix_fn" name="fn" value="10"
|
| 361 |
+
class="pl-12 pr-4 py-3 bg-gray-700/80 border border-gray-500 rounded-xl focus:ring-4 focus:ring-red-500/30 transition-all duration-200 w-full"
|
| 362 |
+
spellcheck="false" />
|
| 363 |
+
</div>
|
| 364 |
+
</div>
|
| 365 |
+
<p class="info mt-2 ml-2">
|
| 366 |
+
<i class="fas fa-info-circle"></i>
|
| 367 |
+
<span><strong>FN (Falso Negativo):</strong> casos positivos erroneamente classificados como negativos (Erro Tipo II).</span>
|
| 368 |
</p>
|
|
|
|
|
|
|
| 369 |
</div>
|
| 370 |
</div>
|
| 371 |
|
| 372 |
<!-- Analyze Button -->
|
| 373 |
+
<div class="text-center mt-10">
|
| 374 |
+
<button type="button" id="analyzeBtn" class="group">
|
| 375 |
+
<i class="fas fa-magic mr-3 transform group-hover:rotate-12 transition-transform"></i>
|
| 376 |
+
<span class="uppercase font-semibold tracking-wide">Gerar Análise</span>
|
| 377 |
+
<i class="fas fa-wand-sparkles ml-2 transform group-hover:scale-110 transition-transform"></i>
|
| 378 |
</button>
|
| 379 |
</div>
|
| 380 |
|
| 381 |
<!-- Related Tools -->
|
| 382 |
+
<div class="cf mt-8 text-center border-t border-gray-700/50 pt-6">
|
| 383 |
+
<span class="opacity-80 block mb-4">Aprofunde sua análise com:</span>
|
| 384 |
+
<div class="flex flex-wrap justify-center gap-4">
|
| 385 |
+
<a href="#" class="hover:text-blue-300 transition-all duration-300 inline-flex items-center bg-blue-600/20 hover:bg-blue-600/30 px-4 py-2 rounded-full border border-blue-500/20 hover:border-blue-500/40">
|
| 386 |
+
<i class="fas fa-chart-line mr-2"></i> Curva ROC
|
| 387 |
+
</a>
|
| 388 |
+
<a href="#" class="hover:text-purple-300 transition-all duration-300 inline-flex items-center bg-purple-600/20 hover:bg-purple-600/30 px-4 py-2 rounded-full border border-purple-500/20 hover:border-purple-500/40">
|
| 389 |
+
<i class="fas fa-fingerprint mr-2"></i> F1-Score
|
| 390 |
+
</a>
|
| 391 |
+
<a href="#" class="hover:text-green-300 transition-all duration-300 inline-flex items-center bg-green-600/20 hover:bg-green-600/30 px-4 py-2 rounded-full border border-green-500/20 hover:border-green-500/40">
|
| 392 |
+
<i class="fas fa-heartbeat mr-2"></i> Sensibilidade/Specificidade
|
| 393 |
+
</a>
|
| 394 |
+
</div>
|
| 395 |
</div>
|
| 396 |
</div>
|
| 397 |
|
| 398 |
<!-- Confusion Matrix Display -->
|
| 399 |
<div id="matrixContainer" class="mt-12 hidden fade-in">
|
| 400 |
+
<h3 class="text-3xl font-bold text-center bg-gradient-to-r from-blue-100 to-purple-100 bg-clip-text text-transparent mb-8 flex items-center justify-center">
|
| 401 |
+
<i class="fas fa-th-large mr-3 text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-purple-400"></i>Matriz de Confusão Visual
|
| 402 |
</h3>
|
| 403 |
<div class="flex justify-center">
|
| 404 |
<table class="matrix text-white text-center min-w-full max-w-2xl">
|
| 405 |
+
<thead class="bg-gradient-to-r from-gray-800 to-gray-800/90">
|
| 406 |
<tr>
|
| 407 |
<th class="matrix-header" style="width: 25%;"></th>
|
| 408 |
<th class="matrix-header" style="width: 37.5%;">Previsto: SIM</th>
|
|
|
|
| 410 |
</tr>
|
| 411 |
</thead>
|
| 412 |
<tbody>
|
| 413 |
+
<tr>
|
| 414 |
<td class="matrix-header">Real: SIM</td>
|
| 415 |
+
<td id="cell_tp" class="matrix-cell text-3xl font-extrabold">PV</td>
|
| 416 |
+
<td id="cell_fn" class="matrix-cell text-3xl font-extrabold">FN</td>
|
| 417 |
</tr>
|
| 418 |
+
<tr>
|
| 419 |
<td class="matrix-header">Real: NÃO</td>
|
| 420 |
+
<td id="cell_fp" class="matrix-cell text-3xl font-extrabold">FP</td>
|
| 421 |
+
<td id="cell_tn" class="matrix-cell text-3xl font-extrabold">NV</td>
|
| 422 |
</tr>
|
| 423 |
</tbody>
|
| 424 |
</table>
|
|
|
|
| 427 |
|
| 428 |
<!-- Metrics Display -->
|
| 429 |
<div id="metricsContainer" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mt-12 hidden fade-in">
|
| 430 |
+
<div class="tooltip metric-card group">
|
| 431 |
+
<div class="metric-title">ACURÁCIA</div>
|
| 432 |
<div id="accuracy" class="metric-value">--</div>
|
| 433 |
+
<div class="tooltiptext">Proporção geral de acertos. (PV + NV) / Total</div>
|
| 434 |
</div>
|
| 435 |
+
<div class="tooltip metric-card group">
|
| 436 |
+
<div class="metric-title">PRECISÃO</div>
|
| 437 |
<div id="precision" class="metric-value">--</div>
|
| 438 |
+
<div class="tooltiptext">Qualidade das previsões positivas. PV / (PV + FP)</div>
|
| 439 |
</div>
|
| 440 |
+
<div class="tooltip metric-card group">
|
| 441 |
+
<div class="metric-title">SENSIBILIDADE</div>
|
| 442 |
<div id="recall" class="metric-value">--</div>
|
| 443 |
+
<div class="tooltiptext">Capacidade de detectar positivos. PV / (PV + FN)</div>
|
| 444 |
</div>
|
| 445 |
+
<div class="tooltip metric-card group">
|
| 446 |
+
<div class="metric-title">ESPECIFICIDADE</div>
|
| 447 |
<div id="specificity" class="metric-value">--</div>
|
| 448 |
+
<div class="tooltiptext">Capacidade de detectar negativos. NV / (NV + FP)</div>
|
| 449 |
+
</div>
|
| 450 |
+
</div>
|
| 451 |
+
|
| 452 |
+
<!-- Key Insights -->
|
| 453 |
+
<div id="insightsContainer" class="mt-10 hidden fade-in">
|
| 454 |
+
<h3 class="text-2xl font-bold text-center bg-gradient-to-r from-green-100 to-blue-100 bg-clip-text text-transparent mb-6">
|
| 455 |
+
<i class="fas fa-chart-pie mr-3"></i>Insights do Modelo
|
| 456 |
+
</h3>
|
| 457 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 458 |
+
<div class="bg-gradient-to-br from-green-900/30 to-green-800/30 p-5 rounded-xl border border-green-700/30">
|
| 459 |
+
<h4 class="font-bold text-green-300 mb-3 flex items-center">
|
| 460 |
+
<i class="fas fa-check-circle mr-3"></i> Forças do Modelo
|
| 461 |
+
</h4>
|
| 462 |
+
<ul id="strengths" class="text-gray-200 text-sm space-y-2 ml-2"></ul>
|
| 463 |
+
</div>
|
| 464 |
+
<div class="bg-gradient-to-br from-orange-900/30 to-orange-800/30 p-5 rounded-xl border border-orange-700/30">
|
| 465 |
+
<h4 class="font-bold text-orange-300 mb-3 flex items-center">
|
| 466 |
+
<i class="fas fa-exclamation-triangle mr-3"></i> Áreas de Melhoria
|
| 467 |
+
</h4>
|
| 468 |
+
<ul id="improvements" class="text-gray-200 text-sm space-y-2 ml-2"></ul>
|
| 469 |
+
</div>
|
| 470 |
</div>
|
| 471 |
</div>
|
| 472 |
|
| 473 |
<!-- Instructions -->
|
| 474 |
<div class="instructions mt-14">
|
| 475 |
+
<h3><i class="fas fa-lightbulb mr-3 text-yellow-400"></i>Guia de Utilização</h3>
|
| 476 |
<ul>
|
| 477 |
+
<li><strong>PV (Positivo Verdadeiro):</strong> Casos que são positivos e foram corretamente identificados como positivos pelo modelo.</li>
|
| 478 |
+
<li><strong>FP (Falso Positivo):</strong> Casos que são negativos mas foram erroneamente classificados como positivos (Alarme falso).</li>
|
| 479 |
+
<li><strong>NV (Negativo Verdadeiro):</strong> Casos que são negativos e foram corretamente identificados como negativos pelo modelo.</li>
|
| 480 |
+
<li><strong>FN (Falso Negativo):</strong> Casos que são positivos mas foram erroneamente classificados como negativos (Erro grave).</li>
|
| 481 |
</ul>
|
| 482 |
+
<p class="mt-4">Após preencher os valores, clique em <strong class="text-blue-300">"Gerar Análise"</strong> para visualizar a matriz e as métricas de desempenho do seu modelo.</p>
|
| 483 |
+
<div class="mt-5 p-4 bg-blue-900/30 rounded-lg border border-blue-800/40">
|
| 484 |
+
<p class="flex items-start">
|
| 485 |
+
<i class="fas fa-star text-yellow-400 mr-3 mt-1"></i> <strong>Dica Profissional:</strong> Priorize a redução de Falsos Negativos em aplicações médicas ou de segurança, mesmo que isso aumente os Falsos Positivos.
|
| 486 |
+
</p>
|
| 487 |
+
</div>
|
| 488 |
</div>
|
| 489 |
|
| 490 |
</div>
|
| 491 |
|
| 492 |
<!-- Footer -->
|
| 493 |
+
<footer class="mt-20">
|
| 494 |
+
<div class="container mx-auto px-4">
|
| 495 |
+
<div class="flex flex-col md:flex-row justify-between items-center">
|
| 496 |
+
<p class="mb-4 md:mb-0">
|
| 497 |
+
© 2023 Matriz de Confusão | Feito com
|
| 498 |
+
<i class="fas fa-heart text-red-500 mx-1"></i>
|
| 499 |
+
para cientistas de dados e estudantes
|
| 500 |
+
</p>
|
| 501 |
+
<div class="flex space-x-6">
|
| 502 |
+
<a href="#" class="text-gray-400 hover:text-blue-300 transition-colors">
|
| 503 |
+
<i class="fab fa-github text-xl"></i>
|
| 504 |
+
</a>
|
| 505 |
+
<a href="#" class="text-gray-400 hover:text-blue-300 transition-colors">
|
| 506 |
+
<i class="fab fa-linkedin text-xl"></i>
|
| 507 |
+
</a>
|
| 508 |
+
<a href="#" class="text-gray-400 hover:text-blue-300 transition-colors">
|
| 509 |
+
<i class="fab fa-twitter text-xl"></i>
|
| 510 |
+
</a>
|
| 511 |
+
</div>
|
| 512 |
+
</div>
|
| 513 |
+
<div class="mt-6 text-gray-500 text-xs">
|
| 514 |
+
<p>Para fins educacionais e análise de modelos de classificação binária</p>
|
| 515 |
+
</div>
|
| 516 |
+
</div>
|
| 517 |
</footer>
|
| 518 |
|
| 519 |
<script>
|
|
|
|
| 533 |
// Show matrix and metrics with fade-in effect
|
| 534 |
const matrixContainer = document.getElementById('matrixContainer');
|
| 535 |
const metricsContainer = document.getElementById('metricsContainer');
|
| 536 |
+
const insightsContainer = document.getElementById('insightsContainer');
|
| 537 |
+
|
| 538 |
matrixContainer.classList.remove('hidden');
|
| 539 |
metricsContainer.classList.remove('hidden');
|
| 540 |
+
insightsContainer.classList.remove('hidden');
|
| 541 |
+
|
|
|
|
| 542 |
// Force reflow to restart animation
|
| 543 |
void matrixContainer.offsetWidth;
|
| 544 |
+
matrixContainer.classList.add('fade-in');
|
| 545 |
+
metricsContainer.classList.add('fade-in');
|
| 546 |
+
insightsContainer.classList.add('fade-in');
|
| 547 |
|
| 548 |
// Calculate metrics
|
| 549 |
const total = tp + fp + tn + fn;
|
|
|
|
| 557 |
document.getElementById('precision').textContent = precision.toFixed(3);
|
| 558 |
document.getElementById('recall').textContent = recall.toFixed(3);
|
| 559 |
document.getElementById('specificity').textContent = specificity.toFixed(3);
|
| 560 |
+
|
| 561 |
+
// Generate insights
|
| 562 |
+
const strengthsList = document.getElementById('strengths');
|
| 563 |
+
const improvementsList = document.getElementById('improvements');
|
| 564 |
+
|
| 565 |
+
// Clear previous insights
|
| 566 |
+
strengthsList.innerHTML = '';
|
| 567 |
+
improvementsList.innerHTML = '';
|
| 568 |
+
|
| 569 |
+
// Add new insights based on metrics
|
| 570 |
+
if (accuracy > 0.85) {
|
| 571 |
+
const li = document.createElement('li');
|
| 572 |
+
li.innerHTML = '<i class="fas fa-check text-green-400 mr-2"></i> Modelo com alta acurácia geral';
|
| 573 |
+
strengthsList.appendChild(li);
|
| 574 |
+
} else {
|
| 575 |
+
const li = document.createElement('li');
|
| 576 |
+
li.innerHTML = '<i class="fas fa-arrow-down text-orange-400 mr-2"></i> Acurácia pode ser melhorada';
|
| 577 |
+
improvementsList.appendChild(li);
|
| 578 |
+
}
|
| 579 |
+
|
| 580 |
+
if (recall > 0.8) {
|
| 581 |
+
const li = document.createElement('li');
|
| 582 |
+
li.innerHTML = '<i class="fas fa-check text-green-400 mr-2"></i> Boa detecção de casos positivos';
|
| 583 |
+
strengthsList.appendChild(li);
|
| 584 |
+
} else {
|
| 585 |
+
const li = document.createElement('li');
|
| 586 |
+
li.innerHTML = '<i class="fas fa-arrow-down text-orange-400 mr-2"></i> Poucos casos positivos estão sendo identificados';
|
| 587 |
+
improvementsList.appendChild(li);
|
| 588 |
+
}
|
| 589 |
+
|
| 590 |
+
if (specificity > 0.8) {
|
| 591 |
+
const li = document.createElement('li');
|
| 592 |
+
li.innerHTML = '<i class="fas fa-check text-green-400 mr-2"></i> Boa detecção de casos negativos';
|
| 593 |
+
strengthsList.appendChild(li);
|
| 594 |
+
} else {
|
| 595 |
+
const li = document.createElement('li');
|
| 596 |
+
li.innerHTML = '<i class="fas fa-arrow-down text-orange-400 mr-2"></i> Muitos casos negativos estão sendo mal classificados';
|
| 597 |
+
improvementsList.appendChild(li);
|
| 598 |
+
}
|
| 599 |
+
|
| 600 |
+
if (precision > 0.8) {
|
| 601 |
+
const li = document.createElement('li');
|
| 602 |
+
li.innerHTML = '<i class="fas fa-check text-green-400 mr-2"></i> Alta confiança nas previsões positivas';
|
| 603 |
+
strengthsList.appendChild(li);
|
| 604 |
+
} else {
|
| 605 |
+
const li = document.createElement('li');
|
| 606 |
+
li.innerHTML = '<i class="fas fa-arrow-down text-orange-400 mr-2"></i> Muitos falsos positivos reduzem a confiança';
|
| 607 |
+
improvementsList.appendChild(li);
|
| 608 |
+
}
|
| 609 |
+
|
| 610 |
+
// If no items in strengths, add general one
|
| 611 |
+
if (strengthsList.children.length === 0) {
|
| 612 |
+
const li = document.createElement('li');
|
| 613 |
+
li.innerHTML = '<i class="fas fa-check text-green-400 mr-2"></i> Modelo apresentando desempenho básico';
|
| 614 |
+
strengthsList.appendChild(li);
|
| 615 |
+
}
|
| 616 |
+
});
|
| 617 |
+
|
| 618 |
+
// Add animation to matrix cells
|
| 619 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 620 |
+
const cells = document.querySelectorAll('.matrix-cell');
|
| 621 |
+
cells.forEach(cell => {
|
| 622 |
+
cell.addEventListener('mouseenter', function() {
|
| 623 |
+
this.style.transform = 'scale(1.1) translateY(-5px)';
|
| 624 |
+
});
|
| 625 |
+
|
| 626 |
+
cell.addEventListener('mouseleave', function() {
|
| 627 |
+
this.style.transform = 'scale(1) translateY(0)';
|
| 628 |
+
});
|
| 629 |
+
});
|
| 630 |
});
|
| 631 |
</script>
|
| 632 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-qwensite.hf.space/logo.svg" alt="qwensite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-qwensite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >QwenSite</a> - 🧬 <a href="https://enzostvs-qwensite.hf.space?remix=alexandremoraisdarosa/matriz-confusao" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
prompts.txt
CHANGED
|
@@ -1,2 +1,3 @@
|
|
| 1 |
Em português. Use as cores branca, preta e azul escuro. Crie um Aplicativo de Matriz de Confusão. Gere instruções de uso. Considere parte do código: <!-- center --> <div id="center"> <h1 id="title">Confusion Matrix</h1> <div id="breadcrumps"><ol itemscope itemtype="http://schema.org/BreadcrumbList"><li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" href="https://www.dcode.fr/tools-list#data_processing"><span itemprop="name">Data Processing</span></a><meta itemprop="position" content="1" /></li><li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" href="https://www.dcode.fr/confusion-matrix"><span itemprop="name">Confusion Matrix</span></a><meta itemprop="position" content="2" /></li></ol></div> <!-- advert --> <div id='div-gpt-ad-1407836191040-0' style='min-width:320px;min-height:100px'></div> <!-- !advert --> <div id="forms"> <h2 class="h2_form" id="f0">Confusion Matrix</h2> <form id="confusion_matrix" method="post"> <p class="info">True Positive (TP) : item declared TRUE, and in reality TRUE</p> <label for="confusion_matrix_tp">Number of True Positive (TP)</label> <input type="text" id="confusion_matrix_tp" name="tp" value="70" size="8" spellcheck="false" class="" /><br/> <p class="info">False Positive (FP) or Type I error: item declared TRUE but in reality FALSE</p> <label for="confusion_matrix_fp">Number of False Positive (FP)</label> <input type="text" id="confusion_matrix_fp" name="fp" value="5" size="8" spellcheck="false" class="" /><br/> <p class="info">True Negative (TN): item declared FALSE, and in reality FALSE</p> <label for="confusion_matrix_tn">Number of True Negative (TN)</label> <input type="text" id="confusion_matrix_tn" name="tn" value="15" size="8" spellcheck="false" class="" /><br/> <p class="info">False Negative (FN) or Type II error: item declared FALSE but in reality TRUE</p> <label for="confusion_matrix_fn">Number of False Negative (FN)</label> <input type="text" id="confusion_matrix_fn" name="fn" value="10" size="8" spellcheck="false" class="" /><br/> <button data-post="tp,fp,tn,fn" post="tp,fp,tn,fn">Analyze</button> <div class="cf "><span>See also:</span> <a href="/precision-recall">Precision and Recall</a> — <a href="/sensibility-specificity">Sensitivity and Specificity</a></div> </form> </div> <!-- advert --> <div id='div-gpt-ad-1407836210596-0' style='min-width:336px;min-height:280px'></div>
|
| 2 |
-
Melhore o UX, tornando mais agradável e visual. Pode alterar as cores
|
|
|
|
|
|
| 1 |
Em português. Use as cores branca, preta e azul escuro. Crie um Aplicativo de Matriz de Confusão. Gere instruções de uso. Considere parte do código: <!-- center --> <div id="center"> <h1 id="title">Confusion Matrix</h1> <div id="breadcrumps"><ol itemscope itemtype="http://schema.org/BreadcrumbList"><li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" href="https://www.dcode.fr/tools-list#data_processing"><span itemprop="name">Data Processing</span></a><meta itemprop="position" content="1" /></li><li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemprop="item" href="https://www.dcode.fr/confusion-matrix"><span itemprop="name">Confusion Matrix</span></a><meta itemprop="position" content="2" /></li></ol></div> <!-- advert --> <div id='div-gpt-ad-1407836191040-0' style='min-width:320px;min-height:100px'></div> <!-- !advert --> <div id="forms"> <h2 class="h2_form" id="f0">Confusion Matrix</h2> <form id="confusion_matrix" method="post"> <p class="info">True Positive (TP) : item declared TRUE, and in reality TRUE</p> <label for="confusion_matrix_tp">Number of True Positive (TP)</label> <input type="text" id="confusion_matrix_tp" name="tp" value="70" size="8" spellcheck="false" class="" /><br/> <p class="info">False Positive (FP) or Type I error: item declared TRUE but in reality FALSE</p> <label for="confusion_matrix_fp">Number of False Positive (FP)</label> <input type="text" id="confusion_matrix_fp" name="fp" value="5" size="8" spellcheck="false" class="" /><br/> <p class="info">True Negative (TN): item declared FALSE, and in reality FALSE</p> <label for="confusion_matrix_tn">Number of True Negative (TN)</label> <input type="text" id="confusion_matrix_tn" name="tn" value="15" size="8" spellcheck="false" class="" /><br/> <p class="info">False Negative (FN) or Type II error: item declared FALSE but in reality TRUE</p> <label for="confusion_matrix_fn">Number of False Negative (FN)</label> <input type="text" id="confusion_matrix_fn" name="fn" value="10" size="8" spellcheck="false" class="" /><br/> <button data-post="tp,fp,tn,fn" post="tp,fp,tn,fn">Analyze</button> <div class="cf "><span>See also:</span> <a href="/precision-recall">Precision and Recall</a> — <a href="/sensibility-specificity">Sensitivity and Specificity</a></div> </form> </div> <!-- advert --> <div id='div-gpt-ad-1407836210596-0' style='min-width:336px;min-height:280px'></div>
|
| 2 |
+
Melhore o UX, tornando mais agradável e visual. Pode alterar as cores
|
| 3 |
+
Troque o preto por cinza escuro
|