Add 2 files
Browse files- index.html +231 -117
- prompts.txt +2 -1
index.html
CHANGED
|
@@ -6,101 +6,181 @@
|
|
| 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 |
<style>
|
| 10 |
body {
|
| 11 |
-
background
|
| 12 |
-
color: #
|
| 13 |
-
font-family: '
|
|
|
|
| 14 |
}
|
| 15 |
#center {
|
| 16 |
-
@apply max-w-
|
| 17 |
}
|
| 18 |
#title {
|
| 19 |
-
@apply text-
|
| 20 |
-
text-shadow: 0 0
|
| 21 |
}
|
| 22 |
#breadcrumps ol {
|
| 23 |
-
@apply flex text-sm mb-
|
|
|
|
| 24 |
}
|
| 25 |
#breadcrumps a {
|
| 26 |
-
@apply hover:text-white transition-
|
|
|
|
|
|
|
|
|
|
| 27 |
}
|
| 28 |
.info {
|
| 29 |
-
@apply text-sm text-gray-300 mt-3 mb-1;
|
|
|
|
|
|
|
|
|
|
| 30 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
label {
|
| 32 |
-
@apply block mt-2 text-white font-
|
| 33 |
}
|
| 34 |
input[type="text"] {
|
| 35 |
-
@apply border border-gray-600 rounded px-
|
| 36 |
}
|
| 37 |
button {
|
| 38 |
-
@apply mt-
|
| 39 |
-
}
|
| 40 |
-
button:hover {
|
| 41 |
-
@apply transform scale-105;
|
| 42 |
}
|
| 43 |
.cf {
|
| 44 |
-
@apply mt-
|
| 45 |
}
|
| 46 |
.cf a {
|
| 47 |
-
@apply text-blue-300 hover:underline;
|
| 48 |
}
|
| 49 |
.matrix {
|
| 50 |
-
@apply mt-
|
| 51 |
-
box-shadow:
|
| 52 |
}
|
| 53 |
-
.matrix
|
| 54 |
-
@apply p-4
|
| 55 |
}
|
| 56 |
.matrix-header {
|
| 57 |
-
@apply bg-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
.metric-card {
|
| 60 |
-
@apply
|
| 61 |
}
|
| 62 |
.metric-title {
|
| 63 |
-
@apply font-bold text-blue-300 text-sm uppercase tracking-
|
| 64 |
}
|
| 65 |
.metric-value {
|
| 66 |
-
@apply text-
|
| 67 |
}
|
| 68 |
.instructions {
|
| 69 |
-
@apply mt-
|
| 70 |
}
|
| 71 |
.instructions h3 {
|
| 72 |
-
@apply font-bold text-white text-lg mb-
|
| 73 |
}
|
| 74 |
.instructions ul {
|
| 75 |
-
@apply list-disc list-inside ml-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
}
|
| 77 |
</style>
|
| 78 |
</head>
|
| 79 |
-
<body class="bg-
|
| 80 |
|
| 81 |
<!-- Header -->
|
| 82 |
-
<header class="bg-blue-950 text-white py-
|
| 83 |
<div class="container mx-auto text-center">
|
| 84 |
-
<h1 class="text-
|
| 85 |
-
<p class="mt-
|
|
|
|
|
|
|
| 86 |
</div>
|
| 87 |
</header>
|
| 88 |
|
| 89 |
<!-- Main Content -->
|
| 90 |
-
<div id="center" class="transition-all duration-
|
| 91 |
|
| 92 |
<!-- Breadcrumb -->
|
| 93 |
-
<div id="breadcrumps">
|
| 94 |
-
<ol itemscope itemtype="http://schema.org/BreadcrumbList" class="flex">
|
| 95 |
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
|
| 96 |
-
<a itemprop="item" href="#" class="flex items-center">
|
|
|
|
| 97 |
<span itemprop="name">Processamento de Dados</span>
|
| 98 |
</a>
|
| 99 |
<meta itemprop="position" content="1" />
|
| 100 |
</li>
|
| 101 |
-
<span class="mx-2"
|
| 102 |
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
|
| 103 |
-
<a itemprop="item" href="#" class="flex items-center">
|
|
|
|
| 104 |
<span itemprop="name">Matriz de Confusão</span>
|
| 105 |
</a>
|
| 106 |
<meta itemprop="position" content="2" />
|
|
@@ -108,77 +188,98 @@
|
|
| 108 |
</ol>
|
| 109 |
</div>
|
| 110 |
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
|
|
|
|
|
|
| 114 |
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
<
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
|
| 147 |
<!-- Analyze Button -->
|
| 148 |
-
<
|
| 149 |
-
<
|
| 150 |
-
|
|
|
|
|
|
|
| 151 |
|
| 152 |
<!-- Related Tools -->
|
| 153 |
-
<div class="cf mt-
|
| 154 |
-
<span>
|
| 155 |
-
<a href="#" class="ml-
|
| 156 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
</div>
|
| 158 |
-
</
|
| 159 |
|
| 160 |
<!-- Confusion Matrix Display -->
|
| 161 |
-
<div id="matrixContainer" class="mt-
|
| 162 |
-
<h3 class="text-
|
|
|
|
|
|
|
| 163 |
<div class="flex justify-center">
|
| 164 |
-
<table class="matrix
|
| 165 |
-
<thead>
|
| 166 |
<tr>
|
| 167 |
-
<th class="matrix-header"></th>
|
| 168 |
-
<th class="matrix-header">Previsto:
|
| 169 |
-
<th class="matrix-header">Previsto:
|
| 170 |
</tr>
|
| 171 |
</thead>
|
| 172 |
<tbody>
|
| 173 |
-
<tr>
|
| 174 |
-
<td class="matrix-header">Real:
|
| 175 |
-
<td id="cell_tp" class="matrix-cell
|
| 176 |
-
<td id="cell_fn" class="matrix-cell
|
| 177 |
</tr>
|
| 178 |
-
<tr>
|
| 179 |
-
<td class="matrix-header">Real:
|
| 180 |
-
<td id="cell_fp" class="matrix-cell
|
| 181 |
-
<td id="cell_tn" class="matrix-cell
|
| 182 |
</tr>
|
| 183 |
</tbody>
|
| 184 |
</table>
|
|
@@ -186,43 +287,47 @@
|
|
| 186 |
</div>
|
| 187 |
|
| 188 |
<!-- Metrics Display -->
|
| 189 |
-
<div id="metricsContainer" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-
|
| 190 |
-
<div class="metric-card">
|
| 191 |
<div class="metric-title">Acurácia</div>
|
| 192 |
<div id="accuracy" class="metric-value">--</div>
|
|
|
|
| 193 |
</div>
|
| 194 |
-
<div class="metric-card">
|
| 195 |
<div class="metric-title">Precisão (PV)</div>
|
| 196 |
<div id="precision" class="metric-value">--</div>
|
|
|
|
| 197 |
</div>
|
| 198 |
-
<div class="metric-card">
|
| 199 |
<div class="metric-title">Sensibilidade</div>
|
| 200 |
<div id="recall" class="metric-value">--</div>
|
|
|
|
| 201 |
</div>
|
| 202 |
-
<div class="metric-card">
|
| 203 |
<div class="metric-title">Especificidade</div>
|
| 204 |
<div id="specificity" class="metric-value">--</div>
|
|
|
|
| 205 |
</div>
|
| 206 |
</div>
|
| 207 |
|
| 208 |
<!-- Instructions -->
|
| 209 |
-
<div class="instructions mt-
|
| 210 |
-
<h3><i class="fas fa-lightbulb mr-
|
| 211 |
<ul>
|
| 212 |
-
<li><strong>PV (Positivo Verdadeiro):</strong>
|
| 213 |
-
<li><strong>FP (Falso Positivo):</strong>
|
| 214 |
-
<li><strong>NV (Negativo Verdadeiro):</strong>
|
| 215 |
-
<li><strong>FN (Falso Negativo):</strong>
|
| 216 |
</ul>
|
| 217 |
-
<p>Após preencher os valores, clique em <strong>Analisar</strong> para gerar a matriz e visualizar métricas de desempenho do modelo.</p>
|
| 218 |
-
<p class="mt-
|
| 219 |
</div>
|
| 220 |
|
| 221 |
</div>
|
| 222 |
|
| 223 |
<!-- Footer -->
|
| 224 |
-
<footer class="
|
| 225 |
-
<p>© 2023
|
| 226 |
</footer>
|
| 227 |
|
| 228 |
<script>
|
|
@@ -239,15 +344,24 @@
|
|
| 239 |
document.getElementById('cell_tn').textContent = tn;
|
| 240 |
document.getElementById('cell_fn').textContent = fn;
|
| 241 |
|
| 242 |
-
// Show matrix and metrics
|
| 243 |
-
document.getElementById('matrixContainer')
|
| 244 |
-
document.getElementById('metricsContainer')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 245 |
|
| 246 |
// Calculate metrics
|
| 247 |
-
const
|
| 248 |
-
const
|
| 249 |
-
const
|
| 250 |
-
const
|
|
|
|
| 251 |
|
| 252 |
// Display metrics
|
| 253 |
document.getElementById('accuracy').textContent = accuracy.toFixed(3);
|
|
|
|
| 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=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
| 10 |
<style>
|
| 11 |
body {
|
| 12 |
+
background: linear-gradient(135deg, #000000 0%, #001833 100%);
|
| 13 |
+
color: #ffffff;
|
| 14 |
+
font-family: 'Inter', sans-serif;
|
| 15 |
+
background-attachment: fixed;
|
| 16 |
}
|
| 17 |
#center {
|
| 18 |
+
@apply max-w-6xl mx-auto p-8 bg-blue-950/30 backdrop-blur-lg rounded-2xl shadow-2xl text-white mt-10 border border-blue-800/30;
|
| 19 |
}
|
| 20 |
#title {
|
| 21 |
+
@apply text-5xl font-extrabold text-center mb-2 bg-gradient-to-r from-white to-blue-200 bg-clip-text text-transparent;
|
| 22 |
+
text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
|
| 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-white transition-all duration-300 flex items-center;
|
| 30 |
+
}
|
| 31 |
+
#breadcrumps a:hover i {
|
| 32 |
+
@apply text-blue-300;
|
| 33 |
}
|
| 34 |
.info {
|
| 35 |
+
@apply text-sm text-gray-300 mt-3 mb-1 flex items-start;
|
| 36 |
+
}
|
| 37 |
+
.info i {
|
| 38 |
+
@apply mr-2 mt-0.5 text-lg;
|
| 39 |
}
|
| 40 |
+
.true-positive .info i { @apply text-green-400; }
|
| 41 |
+
.false-positive .info i { @apply text-yellow-400; }
|
| 42 |
+
.true-negative .info i { @apply text-blue-400; }
|
| 43 |
+
.false-negative .info i { @apply text-red-400; }
|
| 44 |
label {
|
| 45 |
+
@apply block mt-2 text-white font-semibold;
|
| 46 |
}
|
| 47 |
input[type="text"] {
|
| 48 |
+
@apply border border-gray-600 rounded-lg px-4 py-2 bg-gray-800/70 text-white focus:outline-none focus:ring-3 focus:ring-blue-500 transition-all duration-200 w-full;
|
| 49 |
}
|
| 50 |
button {
|
| 51 |
+
@apply mt-6 bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 text-white font-bold py-3 px-8 rounded-xl transition-all duration-300 shadow-lg hover:shadow-xl transform hover:scale-105;
|
|
|
|
|
|
|
|
|
|
| 52 |
}
|
| 53 |
.cf {
|
| 54 |
+
@apply mt-6 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-blue-700 rounded-lg overflow-hidden;
|
| 61 |
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
|
| 62 |
}
|
| 63 |
+
.matrix th, .matrix td {
|
| 64 |
+
@apply p-4;
|
| 65 |
}
|
| 66 |
.matrix-header {
|
| 67 |
+
@apply bg-blue-900/80 text-white text-center font-bold text-base uppercase tracking-wider;
|
| 68 |
+
}
|
| 69 |
+
.matrix-cell {
|
| 70 |
+
@apply text-center font-bold text-lg relative;
|
| 71 |
+
transition: all 0.3s ease;
|
| 72 |
+
}
|
| 73 |
+
.matrix-cell:hover {
|
| 74 |
+
@apply transform scale-105 z-10;
|
| 75 |
}
|
| 76 |
+
#cell_tp { @apply bg-green-900/40 text-green-100; }
|
| 77 |
+
#cell_fp { @apply bg-yellow-900/40 text-yellow-100; }
|
| 78 |
+
#cell_tn { @apply bg-blue-900/40 text-blue-100; }
|
| 79 |
+
#cell_fn { @apply bg-red-900/40 text-red-100; }
|
| 80 |
.metric-card {
|
| 81 |
+
@apply p-6 bg-gradient-to-b from-gray-900/80 to-gray-800/80 backdrop-blur-sm rounded-xl shadow-lg border border-gray-700/50 text-center transition-all duration-300 hover:shadow-xl;
|
| 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-3xl md:text-4xl font-extrabold bg-gradient-to-r from-white to-gray-300 bg-clip-text text-transparent;
|
| 88 |
}
|
| 89 |
.instructions {
|
| 90 |
+
@apply mt-10 p-6 bg-black/30 rounded-xl text-gray-200 text-sm leading-relaxed border border-gray-700/50;
|
| 91 |
}
|
| 92 |
.instructions h3 {
|
| 93 |
+
@apply flex items-center font-bold text-white text-lg mb-3;
|
| 94 |
}
|
| 95 |
.instructions ul {
|
| 96 |
+
@apply list-disc list-inside ml-6 space-y-2 mb-4;
|
| 97 |
+
}
|
| 98 |
+
.instructions p {
|
| 99 |
+
@apply mt-3;
|
| 100 |
+
}
|
| 101 |
+
.tooltip {
|
| 102 |
+
@apply relative inline-block;
|
| 103 |
+
}
|
| 104 |
+
.tooltip .tooltiptext {
|
| 105 |
+
visibility: hidden;
|
| 106 |
+
width: 220px;
|
| 107 |
+
background-color: #1e293b;
|
| 108 |
+
color: #e2e8f0;
|
| 109 |
+
text-align: center;
|
| 110 |
+
border-radius: 6px;
|
| 111 |
+
padding: 8px;
|
| 112 |
+
position: absolute;
|
| 113 |
+
z-index: 1;
|
| 114 |
+
bottom: 125%;
|
| 115 |
+
left: 50%;
|
| 116 |
+
margin-left: -110px;
|
| 117 |
+
opacity: 0;
|
| 118 |
+
transition: opacity 0.3s;
|
| 119 |
+
font-size: 14px;
|
| 120 |
+
border: 1px solid #334155;
|
| 121 |
+
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
|
| 122 |
+
}
|
| 123 |
+
.tooltip .tooltiptext::after {
|
| 124 |
+
content: "";
|
| 125 |
+
position: absolute;
|
| 126 |
+
top: 100%;
|
| 127 |
+
left: 50%;
|
| 128 |
+
margin-left: -5px;
|
| 129 |
+
border-width: 5px;
|
| 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-blue-950/30 backdrop-blur-sm text-gray-400 py-6 text-center text-sm mt-16 border-t border-blue-800/30;
|
| 139 |
+
}
|
| 140 |
+
.fade-in {
|
| 141 |
+
animation: fadeIn 0.6s ease-in-out;
|
| 142 |
+
}
|
| 143 |
+
@keyframes fadeIn {
|
| 144 |
+
from { opacity: 0; transform: translateY(10px); }
|
| 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-900/50 to-gray-800/50 p-8 rounded-2xl shadow-xl border border-gray-700/50;
|
| 152 |
}
|
| 153 |
</style>
|
| 154 |
</head>
|
| 155 |
+
<body class="bg-black text-white">
|
| 156 |
|
| 157 |
<!-- Header -->
|
| 158 |
+
<header class="bg-blue-950/80 backdrop-blur-sm text-white py-8 shadow-lg">
|
| 159 |
<div class="container mx-auto text-center">
|
| 160 |
+
<h1 class="text-4xl font-bold"><i class="fas fa-project-diagram mr-3"></i>Aplicativo de Matriz de Confusão</h1>
|
| 161 |
+
<p class="mt-3 text-blue-200 text-lg max-w-3xl mx-auto leading-relaxed">
|
| 162 |
+
Analise o desempenho do seu modelo de classificação com precisão e facilidade. Insira os valores e obtenha métricas essenciais em segundos.
|
| 163 |
+
</p>
|
| 164 |
</div>
|
| 165 |
</header>
|
| 166 |
|
| 167 |
<!-- Main Content -->
|
| 168 |
+
<div id="center" class="transition-all duration-500 ease-in-out">
|
| 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 |
+
<i class="fas fa-database mr-1"></i>
|
| 176 |
<span itemprop="name">Processamento de Dados</span>
|
| 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-blue-300 transition-colors">
|
| 183 |
+
<i class="fas fa-project-diagram mr-1"></i>
|
| 184 |
<span itemprop="name">Matriz de Confusão</span>
|
| 185 |
</a>
|
| 186 |
<meta itemprop="position" content="2" />
|
|
|
|
| 188 |
</ol>
|
| 189 |
</div>
|
| 190 |
|
| 191 |
+
<div class="form-container mt-8">
|
| 192 |
+
<!-- Confusion Matrix Form -->
|
| 193 |
+
<h2 class="h2_form text-3xl font-bold text-center text-white mb-6 flex items-center justify-center">
|
| 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 |
+
<p class="info">
|
| 201 |
+
<i class="fas fa-check-circle"></i>
|
| 202 |
+
<span><strong>Positivo Verdadeiro (PV):</strong> itens corretamente previstos como positivos (verdadeiros positivos).</span>
|
| 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 |
+
<p class="info">
|
| 211 |
+
<i class="fas fa-exclamation-triangle"></i>
|
| 212 |
+
<span><strong>Falso Positivo (FP):</strong> itens negativos classificados incorretamente como positivos (Erro Tipo I).</span>
|
| 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 |
+
<p class="info">
|
| 221 |
+
<i class="fas fa-check-circle"></i>
|
| 222 |
+
<span><strong>Negativo Verdadeiro (NV):</strong> itens corretamente previstos como negativos (verdadeiros negativos).</span>
|
| 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 |
+
<p class="info">
|
| 231 |
+
<i class="fas fa-times-circle"></i>
|
| 232 |
+
<span><strong>Falso Negativo (FN):</strong> itens positivos classificados incorretamente como negativos (Erro Tipo II).</span>
|
| 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-8">
|
| 241 |
+
<button type="button" id="analyzeBtn" class="flex items-center justify-center mx-auto">
|
| 242 |
+
<i class="fas fa-calculator mr-3"></i> <span class="uppercase font-semibold">Analisar Resultados</span>
|
| 243 |
+
</button>
|
| 244 |
+
</div>
|
| 245 |
|
| 246 |
<!-- Related Tools -->
|
| 247 |
+
<div class="cf mt-8 text-center">
|
| 248 |
+
<span class="opacity-80">Explore também:</span>
|
| 249 |
+
<a href="#" class="ml-2 hover:text-blue-300 transition-colors inline-flex items-center">
|
| 250 |
+
<i class="fas fa-chart-line mr-1"></i> Precisão e Revocação
|
| 251 |
+
</a>
|
| 252 |
+
<span class="mx-2 opacity-50">|</span>
|
| 253 |
+
<a href="#" class="hover:text-blue-300 transition-colors inline-flex items-center">
|
| 254 |
+
<i class="fas fa-heartbeat mr-1"></i> Sensibilidade e Especificidade
|
| 255 |
+
</a>
|
| 256 |
</div>
|
| 257 |
+
</div>
|
| 258 |
|
| 259 |
<!-- Confusion Matrix Display -->
|
| 260 |
+
<div id="matrixContainer" class="mt-12 hidden fade-in">
|
| 261 |
+
<h3 class="text-2xl font-bold text-center text-white mb-6 flex items-center justify-center">
|
| 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-900 to-gray-800">
|
| 267 |
<tr>
|
| 268 |
+
<th class="matrix-header" style="width: 25%;"></th>
|
| 269 |
+
<th class="matrix-header" style="width: 37.5%;">Previsto: SIM</th>
|
| 270 |
+
<th class="matrix-header" style="width: 37.5%;">Previsto: NÃO</th>
|
| 271 |
</tr>
|
| 272 |
</thead>
|
| 273 |
<tbody>
|
| 274 |
+
<tr class="bg-gradient-to-r from-gray-900/50 to-gray-950/50">
|
| 275 |
+
<td class="matrix-header">Real: SIM</td>
|
| 276 |
+
<td id="cell_tp" class="matrix-cell text-2xl">PV</td>
|
| 277 |
+
<td id="cell_fn" class="matrix-cell text-2xl">FN</td>
|
| 278 |
</tr>
|
| 279 |
+
<tr class="bg-gradient-to-r from-gray-800/50 to-gray-900/50">
|
| 280 |
+
<td class="matrix-header">Real: NÃO</td>
|
| 281 |
+
<td id="cell_fp" class="matrix-cell text-2xl">FP</td>
|
| 282 |
+
<td id="cell_tn" class="matrix-cell text-2xl">NV</td>
|
| 283 |
</tr>
|
| 284 |
</tbody>
|
| 285 |
</table>
|
|
|
|
| 287 |
</div>
|
| 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">Acurácia</div>
|
| 293 |
<div id="accuracy" class="metric-value">--</div>
|
| 294 |
+
<div class="tooltiptext">Proporção de previsões corretas (PV + NV) / Total</div>
|
| 295 |
</div>
|
| 296 |
+
<div class="tooltip metric-card">
|
| 297 |
<div class="metric-title">Precisão (PV)</div>
|
| 298 |
<div id="precision" class="metric-value">--</div>
|
| 299 |
+
<div class="tooltiptext">Entre os classificados como positivos, quantos são realmente positivos? (PV / (PV+FP))</div>
|
| 300 |
</div>
|
| 301 |
+
<div class="tooltip metric-card">
|
| 302 |
<div class="metric-title">Sensibilidade</div>
|
| 303 |
<div id="recall" class="metric-value">--</div>
|
| 304 |
+
<div class="tooltiptext">Capacidade de identificar positivos: PV / (PV+FN)</div>
|
| 305 |
</div>
|
| 306 |
+
<div class="tooltip metric-card">
|
| 307 |
<div class="metric-title">Especificidade</div>
|
| 308 |
<div id="specificity" class="metric-value">--</div>
|
| 309 |
+
<div class="tooltiptext">Capacidade de identificar negativos: NV / (NV+FP)</div>
|
| 310 |
</div>
|
| 311 |
</div>
|
| 312 |
|
| 313 |
<!-- Instructions -->
|
| 314 |
+
<div class="instructions mt-14">
|
| 315 |
+
<h3><i class="fas fa-lightbulb mr-3"></i>Instruções de Uso</h3>
|
| 316 |
<ul>
|
| 317 |
+
<li><strong>PV (Positivo Verdadeiro):</strong> Instâncias que são positivas e foram classificadas corretamente como positivas.</li>
|
| 318 |
+
<li><strong>FP (Falso Positivo):</strong> Instâncias que são negativas mas foram classificadas erradamente como positivas.</li>
|
| 319 |
+
<li><strong>NV (Negativo Verdadeiro):</strong> Instâncias que são negativas e foram classificadas corretamente como negativas.</li>
|
| 320 |
+
<li><strong>FN (Falso Negativo):</strong> Instâncias que são positivas mas foram classificadas erradamente como negativas.</li>
|
| 321 |
</ul>
|
| 322 |
+
<p>Após preencher os valores, clique em <strong class="text-blue-300">"Analisar Resultados"</strong> para gerar a matriz e visualizar as métricas de desempenho do modelo.</p>
|
| 323 |
+
<p class="mt-4"><i class="fas fa-star text-yellow-400 mr-2"></i> <strong>Dica:</strong> Valores devem ser números inteiros positivos. Use esse aplicativo para avaliações rápidas ou aprendizado!</p>
|
| 324 |
</div>
|
| 325 |
|
| 326 |
</div>
|
| 327 |
|
| 328 |
<!-- Footer -->
|
| 329 |
+
<footer class="mt-16">
|
| 330 |
+
<p>© 2023 Matriz de Confusão | Feito com <i class="fas fa-heart text-red-500"></i> para cientistas de dados e estudantes</p>
|
| 331 |
</footer>
|
| 332 |
|
| 333 |
<script>
|
|
|
|
| 344 |
document.getElementById('cell_tn').textContent = tn;
|
| 345 |
document.getElementById('cell_fn').textContent = fn;
|
| 346 |
|
| 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 |
+
matrixContainer.classList.add('fade-in');
|
| 353 |
+
metricsContainer.classList.add('fade-in');
|
| 354 |
+
|
| 355 |
+
// Force reflow to restart animation
|
| 356 |
+
void matrixContainer.offsetWidth;
|
| 357 |
+
void metricsContainer.offsetWidth;
|
| 358 |
|
| 359 |
// Calculate metrics
|
| 360 |
+
const total = tp + fp + tn + fn;
|
| 361 |
+
const accuracy = total > 0 ? (tp + tn) / total : 0;
|
| 362 |
+
const precision = (tp + fp) > 0 ? tp / (tp + fp) : 0;
|
| 363 |
+
const recall = (tp + fn) > 0 ? tp / (tp + fn) : 0; // also known as sensitivity
|
| 364 |
+
const specificity = (tn + fp) > 0 ? tn / (tn + fp) : 0;
|
| 365 |
|
| 366 |
// Display metrics
|
| 367 |
document.getElementById('accuracy').textContent = accuracy.toFixed(3);
|
prompts.txt
CHANGED
|
@@ -1 +1,2 @@
|
|
| 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>
|
|
|
|
|
|
| 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
|