A confusion matrix counts binary-classification outcomes by comparing predicted and actual labels. Matching labels produce true positives or true negatives; mismatches produce false positives or false negatives. section 5.2
Read the four cells as:
- True positive (TP) and true negative (TN): correct predictions. section 5.2
- False positive (FP) and false negative (FN): incorrect predictions. section 5.2
- Changing the classification threshold changes all four counts. section 5.2
Perceptron evaluation
A perceptron classifier can be evaluated with a confusion matrix on the iris dataset; Python code imports scikit-learn's confusion_matrix utility.













