False Negative Rate Calculator

False Negative Rate Calculator .fnr-calculator-container { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; max-width: 800px; margin: 0 auto; padding: 20px; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); } .fnr-header { text-align: center; margin-bottom: 30px; background-color: #f8f9fa; padding: 20px; border-radius: 6px; } .fnr-header h2 { margin: 0; color: #2c3e50; } .fnr-row { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; } .fnr-col { flex: 1; min-width: 250px; } .fnr-input-group { margin-bottom: 15px; } .fnr-input-group label { display: block; margin-bottom: 5px; font-weight: 600; color: #333; } .fnr-input-group input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px; box-sizing: border-box; /* Important for padding */ } .fnr-input-group input:focus { border-color: #007bff; outline: none; box-shadow: 0 0 0 2px rgba(0,123,255,0.25); } .fnr-help-text { font-size: 12px; color: #666; margin-top: 4px; } .fnr-btn { width: 100%; padding: 12px; background-color: #007bff; color: white; border: none; border-radius: 4px; font-size: 18px; cursor: pointer; transition: background-color 0.2s; } .fnr-btn:hover { background-color: #0056b3; } .fnr-result-box { margin-top: 30px; padding: 20px; background-color: #eef7ff; border-left: 5px solid #007bff; border-radius: 4px; display: none; } .fnr-result-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #dcdcdc; } .fnr-result-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; } .fnr-result-label { font-weight: 600; color: #333; } .fnr-result-value { font-size: 20px; font-weight: 700; color: #007bff; } .fnr-content { margin-top: 40px; line-height: 1.6; color: #333; } .fnr-content h3 { border-bottom: 2px solid #f0f0f0; padding-bottom: 10px; margin-top: 30px; } .fnr-matrix { border-collapse: collapse; width: 100%; margin: 20px 0; text-align: center; } .fnr-matrix th, .fnr-matrix td { border: 1px solid #ddd; padding: 10px; } .fnr-matrix th { background-color: #f8f9fa; }

False Negative Rate Calculator

Calculate Type II Error Rate from Confusion Matrix Data

Positive cases incorrectly classified as negative.
Positive cases correctly classified as positive.
False Negative Rate (FNR): 0%
Sensitivity (Recall): 0%
Total Actual Positives (P): 0

What is False Negative Rate (FNR)?

The False Negative Rate (FNR) is a statistical metric used in binary classification and medical testing. It represents the proportion of actual positive cases that were incorrectly classified as negative. In statistics, this is known as a Type II Error.

In a medical context, a false negative is arguably the most dangerous error, as it involves telling a sick patient that they are healthy, potentially delaying necessary treatment.

Formula

The formula for calculating the False Negative Rate is:

FNR = FN / (FN + TP)

Where:

  • FN (False Negatives): The number of positive items incorrectly labeled as negative.
  • TP (True Positives): The number of positive items correctly labeled as positive.
  • FN + TP: Represents the Total Actual Positive cases (often denoted as P).

Example Calculation

Imagine a spam filter testing 200 emails, where 100 are actually spam (Total Positives).

  • The filter correctly identifies 90 emails as spam (TP = 90).
  • The filter misses 10 spam emails, letting them into the inbox (FN = 10).

Calculation:

FNR = 10 / (10 + 90) = 10 / 100 = 0.10

The False Negative Rate is 10%. This means 10% of the spam emails were missed.

Relationship to Sensitivity

The False Negative Rate is the complement of Sensitivity (also known as Recall or True Positive Rate). If you know the Sensitivity of a test, you can easily find the FNR:

FNR = 1 – Sensitivity

function calculateFNR() { // Get input values var fnInput = document.getElementById('fnInput'); var tpInput = document.getElementById('tpInput'); var resultBox = document.getElementById('fnrResult'); // Parse values var fn = parseFloat(fnInput.value); var tp = parseFloat(tpInput.value); // Validation if (isNaN(fn) || isNaN(tp)) { alert("Please enter valid numbers for both False Negatives and True Positives."); resultBox.style.display = "none"; return; } if (fn < 0 || tp < 0) { alert("Values cannot be negative."); resultBox.style.display = "none"; return; } // Calculation Logic var totalPositives = fn + tp; if (totalPositives === 0) { alert("Total Actual Positives (FN + TP) equals zero. Cannot divide by zero."); resultBox.style.display = "none"; return; } var fnr = fn / totalPositives; var sensitivity = tp / totalPositives; // Sensitivity = 1 – FNR // Formatting results (Percentage) var fnrPercent = (fnr * 100).toFixed(2) + "%"; var sensitivityPercent = (sensitivity * 100).toFixed(2) + "%"; // Update DOM document.getElementById('resFNR').innerHTML = fnrPercent; document.getElementById('resSensitivity').innerHTML = sensitivityPercent; document.getElementById('resTotalPositives').innerHTML = totalPositives; // Dynamic Interpretation var interpretation = "Out of " + totalPositives + " actual positive cases, the system failed to identify " + fn + " of them."; document.getElementById('resInterpretation').innerHTML = interpretation; // Show result box resultBox.style.display = "block"; }

Leave a Comment