---
title: "Measures from cancer confusion matrix"
subject: "Data Mining"
chapter: 3
key: "semester_7/data_mining:confusion-matrix-cancer"
source: https://www.bctengineer.com/q/semester_7/data_mining/confusion-matrix-cancer
site: BCT Engineering
---

# Measures from cancer confusion matrix

Data Mining · Chapter 3: Classification

- Asked in: year not given
- Video: [Confusion Matrix Solved Example Accuracy Precision Recall F1 Score Prevalence by Mahesh Huddar](https://www.youtube.com/watch?v=_CGTbkHwUHQ) — Mahesh Huddar
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/data_mining/confusion-matrix-cancer
- Whole chapter: https://www.bctengineer.com/md/semester_7/data_mining/chapter-3

## Question

Given the following confusion matrix, determine Accuracy, Error rate, Sensitivity, Specificity, Precision, Recall, Positive Predictive Value and Negative Predictive Value, TPR, TNR, FPR, FNR of the classifier model.

| Actual \ Predicted | cancer = yes | cancer = no |
| --- | --- | --- |
| cancer = yes | 90 | 210 |
| cancer = no | 140 | 9560 |

## Short answer

Accuracy 96.5%, error rate 3.5%, sensitivity/recall/TPR 30%, specificity/TNR 98.56%, precision/PPV 39.1%, NPV 97.85%, FPR 1.44%, FNR 70%.

## Answer

Positive class = cancer = yes (rows are actual, columns predicted):

TP = 90, FN = 210, FP = 140, TN = 9560.
Total = 90 + 210 + 140 + 9560 = 10000. Actual cancer = 300; actual no cancer = 9700.

| Measure | Formula | Calculation | Value |
| --- | --- | --- | --- |
| Accuracy | (TP + TN)/total | (90 + 9560)/10000 | **0.965 (96.5%)** |
| Error rate | (FP + FN)/total | 350/10000 | **0.035 (3.5%)** |
| Sensitivity = Recall = TPR | TP/(TP + FN) | 90/300 | **0.300** |
| Specificity = TNR | TN/(TN + FP) | 9560/9700 | **0.9856** |
| Precision = PPV | TP/(TP + FP) | 90/230 | **0.391** |
| NPV | TN/(TN + FN) | 9560/9770 | **0.9785** |
| FPR | FP/(FP + TN) | 140/9700 | **0.0144** |
| FNR | FN/(FN + TP) | 210/300 | **0.700** |

**Answer: accuracy 96.5%, error rate 3.5%, sensitivity = recall = TPR = 30%, specificity = TNR = 98.56%, precision = PPV = 39.1%, NPV = 97.85%, FPR = 1.44%, FNR = 70%.**

**Comment**: the accuracy is high only because 97% of the records are non-cancer (class imbalance). The classifier misses 70% of the real cancer cases, so for this problem sensitivity (recall) is the important measure and this model is poor.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Accuracy is:
   A. 96.5%
   B. 30%
   C. 39.1%
   D. 98.56%
   Answer: A. (90 + 9560)/10000. (Key point: Accuracy)

2. Sensitivity is:
   A. 30%
   B. 96.5%
   C. 98.56%
   D. 70%
   Answer: A. 90/300. (Key point: Sensitivity)

3. Why is the high accuracy misleading?
   A. The model has high recall
   B. 97% of records are non-cancer (imbalance)
   C. TP is large
   D. FPR is high
   Answer: B. Most records are negative, so accuracy hides 70% missed cancers. (Key point: Misleading accuracy)

4. Precision is:
   A. 90/300
   B. 9560/9770
   C. 90/230 = 0.391
   D. 140/9700
   Answer: C. Predicted positives = 90 + 140. (Key point: Precision)

## Close variants set in other exams

- [Measures from confusion matrix (152, 130)](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Aconfusion-matrix-152-130) — Data Mining, chapter 3
- [Confusion matrix and performance measures](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Aconfusion-matrix-measures) — Data Mining, chapter 3

## Related in other subjects

- [Accuracy, precision, sensitivity, resolution](https://www.bctengineer.com/question.md?key=semester_4%2Finstrumentation_and_measurement%3Aaccuracy-precision-sensitivity-resolution) — Instrumentation and Measurement, chapter 3
