Machine Learning Fundamentals: Scenarios
Scenario questions test judgment: given a realistic situation, what would you check first, and why?
Your model gets 99% training accuracy but 70% on validation. Walk me through what you'd do.
This is a large generalization gap, which points to high variance (overfitting) or a train/validation mismatch.
- Check for bugs and leakage first: is validation preprocessed the same way? Are labels aligned? Is there any leakage into training making it memorizable (IDs, timestamps)?
- Check the distributions: is validation from a different time period, region or source? If so, this may be distribution shift, not classic overfitting.
- Learning curves: if validation improves with more data, collect more or augment.
- Reduce variance: stronger regularization (L2, dropout), simpler models (shallower trees, fewer features), early stopping, ensembling/bagging.
- Error analysis: which validation examples fail? Cluster them; often a missing feature or label noise in a subgroup.
You trained a fraud model and it shows 99.5% accuracy. Your manager is thrilled. Are you?
Not yet. With ~0.5% fraud, predicting "not fraud" for everything gives 99.5% accuracy. Accuracy is meaningless under heavy imbalance.
I'd report: the confusion matrix, precision and recall for the fraud class, PR-AUC, and recall at an operating point the business accepts (e.g., recall at a 1% false-positive rate), plus the expected dollar savings vs the cost of false positives (blocked customers, review time). I'd also compare against simple baselines (rules the fraud team uses today).
A feature has a suspiciously high correlation with the target and gives a huge accuracy boost. What do you suspect?
Target leakage. The feature may be computed after the outcome or derived from it. Examples: "account_closed_reason" when predicting churn, "chargeback_flag" when predicting fraud, or an aggregate computed over a window that includes the future.
Checks: when is the feature available relative to prediction time? How is it computed (trace the pipeline)? What happens to performance on a strict temporal split where features are computed only from past data? If the boost vanishes, it was leakage. Remove it, or recompute it point-in-time.
You have only 500 labeled examples for a new classification task. What's your approach?
- Strong simple baselines: logistic regression or gradient boosting on good features; with text, embeddings from a pre-trained model + logistic regression.
- Transfer learning: fine-tune a pre-trained model (or use few-shot prompting with an LLM, which often works well at this scale).
- Use cross-validation (stratified) rather than a single small validation split, and report confidence intervals.
- Get more signal cheaply: active learning (label the most uncertain examples), weak supervision (labeling functions), LLM-assisted labeling with human verification, data augmentation.
- Keep models small and regularized to avoid overfitting.
Your model performs well offline but poorly after deployment. List likely causes in order of investigation.
- Training–serving skew: features computed differently online (different code path, defaults for missing values, units, time zones). Log online features and compare with offline.
- Data/pipeline bugs: missing or stale features, schema changes upstream.
- Distribution shift: the population or behavior changed since the training data.
- Leakage in offline evaluation: the offline score was inflated (random split on temporal data, leaky features).
- Feedback loops / selection bias: the deployed model changes what data you observe.
- Metric mismatch: the offline metric doesn't reflect the online objective.
The first two are the most common and the cheapest to check.
Stakeholders want a model "as accurate as possible" for loan approval. What do you clarify before building anything?
- The decision and its costs: what's the cost of a false approval (default loss) vs a false rejection (lost customer, fairness harm)? That defines the metric and threshold.
- Constraints: regulatory requirements (explainability of decisions, adverse-action reasons, fairness across protected groups), latency, and allowed features (no protected attributes or proxies).
- Labels: what counts as "default", over what horizon? Label delay affects training windows.
- Population and drift: which applicants, which period, any policy changes?
- Human oversight: is the model advisory or automatic? Is there an appeals process?
This framing turns "accurate" into an optimizable, defensible objective.