Unit 3: Case Studies

3 Real-World Scenarios
Case 1
Text Classification in Practice

Email Spam Filtering — Gmail (Naive Bayes)

Gmail uses a Naive Bayes classifier trained on billions of emails to filter spam. The algorithm calculates the probability that an email is spam based on word frequencies. Despite its simplicity, Naive Bayes achieves 99.9% accuracy on Gmail with false positive rates under 0.1%.

Focus Question:

What "naive" assumption does the Naive Bayes classifier make? A. Features are correlated | B. Features are conditionally independent | C. Features are numeric only | D. Features are binary
Tip: Naive Bayes is "naive" because it assumes independence between features, but this simplification works surprisingly well in practice for text classification.
Case 2
Transparent Financial Classification

Credit Scoring — Banks (Decision Trees)

Banks use Decision Trees (ID3/C4.5) for credit scoring because they provide explainable decisions. A typical model considers income, debt-to-income ratio, credit history length, and number of accounts. Regulatory requirements like the Equal Credit Opportunity Act mandate explainable AI in lending decisions.

Focus Question:

Why do banks prefer Decision Trees over black-box models for credit scoring? A. They are faster to train | B. They are explainable and auditable | C. They always have higher accuracy | D. They require less data
Tip: Information Gain = Parent Entropy - Weighted Average Child Entropy. Higher gain means a better, more informative split.
Case 3
Instance-Based Learning in Healthcare

Medical Diagnosis — Breast Cancer Detection (k-NN)

k-NN is used in medical diagnosis to classify patients based on similarity to known cases. For breast cancer detection, k-NN classifies tumors as benign or malignant by finding the k most similar patients in the training set. The choice of k and distance metric significantly affects diagnosis accuracy.

Focus Question:

Why is k-NN called a "lazy learner"? A. It runs slowly | B. It defers all computation to prediction time | C. It requires no training | D. It uses simple math
Tip: k-NN performance depends heavily on feature scaling, distance metric, and k value — always cross-validate to find optimal parameters.
Theory Activity