1. BINARY CLASSIFICATION – INTRODUCTION Definition: Binary Classification is a supervised learning task where output has only 2 classes. Examples: Spam / Not Spam Fraud / Not Fraud Disease / No Disease Goal: Correctly classify data into one of two categories 2. CONFUSION MATRIX Definition: A table used to evaluate classification performance by comparing actual vs predicted values. Structure: Predicted Positive Predicted Negative Actual Positive TP FN Actual Negative FP TN Definitions: TP (True Positive): Correctly predicted positive TN (True Negative): Correctly predicted negative FP (False Positive): Incorrectly predicted positive FN (False Negative): Incorrectly predicted negative Example: Disease detection: TP → Sick correctly identified FN → Sick but predicted healthy 3. ACCURACY Definition: Measures overall correctness of model Formula: Accuracy = (TP + TN) / (TP + TN + FP + FN) Example: Correct = 90 out of 100 Accuracy = 0.9 (90%) Limitation: Not reliable for imbalanced datasets 4. PRECISION Definition: How many predicted positives are actually correct Formula: Precision = TP / (TP + FP) Use: When false positives are costly Example: Spam detection: Wrongly marking real email as spam is bad 5. RECALL (SENSITIVITY) Definition: How many actual positives are correctly identified Formula: Recall = TP / (TP + FN) Use: When missing positives is costly Example: Disease detection: Missing patient is dangerous 6. F1-SCORE Definition: Harmonic mean of precision and recall Formula: F1 = 2 × (Precision × Recall) / (Precision + Recall) Use: When dataset is imbalanced 7. ROC CURVE Definition: Graph showing performance at different thresholds Axes: X-axis → False Positive Rate (FPR) Y-axis → True Positive Rate (TPR) Formulas: TPR = TP / (TP + FN) FPR = FP / (FP + TN) Interpretation: Closer to top-left → better model Diagonal → random model 8. AUC (AREA UNDER CURVE) Definition: Area under ROC curve Range: 0 to 1 Interpretation: 1 → Perfect 0.5 → Random less than 0.5 → Poor model 9. MULTI-CLASS CLASSIFICATION Definition: Classification with more than 2 classes Example: Digits (0–9), Animals (cat/dog/bird) CHALLENGES More complex evaluation Multiple confusion matrices Class imbalance 10. PER-CLASS PRECISION & RECALL Definition: Metrics calculated for each class individually Example: Class A: Precision = TP_A / (TP_A + FP_A) Recall = TP_A / (TP_A + FN_A) 11. WEIGHTED AVERAGE PRECISION & RECALL Definition: Weighted average based on class size Formula: Weighted Precision = Σ (Precision_class × support_class) / total samples Weighted Recall = Σ (Recall_class × support_class) / total samples EXAMPLE Class A: Precision = 0.8, Support = 50 Class B: Precision = 0.6, Support = 150 Weighted Precision = (0.8×50 + 0.6×150) / 200 = (40 + 90)/200 = 0.65 12. HANDLING MULTI-CLASS PROBLEMS Methods: 1. ONE vs REST (OvR) One class vs all others 2. ONE vs ONE (OvO) Pairwise classification Example: 3 classes → 3 classifiers (OvR) 13. THRESHOLD EFFECT Definition: Changing threshold affects precision & recall High threshold: High precision Low recall Low threshold: Low precision High recall 14. SUMMARY Accuracy: Overall correctness Precision: Correctness of positives Recall: Detection ability F1: Balance of precision & recall ROC: Performance across thresholds AUC: Overall model quality 00:00 Introduction to Binary Classification 00:35 What is Binary Classification 01:06 Confusion Matrix (TP, TN, FP, FN) 01:47 Accuracy Explained 02:23 Precision Explained 02:53 Recall Explained 03:22 F1-Score Explained 03:48 ROC Curve 04:06 AUC Explained 04:27 Multi-class Classification 05:03 Per-class Metrics 05:29 Weighted Averages 06:14 One vs Rest and One vs One 06:46 Threshold Effects 07:13 Final Summary #machinelearning #classification #confusionmatrix #precision #recall #f1score #roc #datascience #aiml #learning