Machine Learning Fundamentals
Machine Learning Fundamentals tests classical ML concepts: problem types, data splitting, generalization, regularization, and evaluation metrics. Expect scenario questions where a metric or split choice decides the answer.
Core rules
- Supervised learning uses labelled data; unsupervised learning finds structure without labels; reinforcement learning learns from reward signals.
- Split data into training, validation, and test sets. Tune on validation, report on test.
- Overfitting means low training error but poor generalization. Regularization (L1/L2), more data, and simpler models reduce it.
- L1 tends to produce sparse weights; L2 shrinks weights smoothly.
- k-fold cross-validation rotates the validation fold to reduce split-dependent luck.
- Fit scalers and encoders on training data only, then apply them to validation and test data.
Worked example
A fraud model is tested on 1,000 transactions: TP=40, FP=10, FN=20, TN=930. Accuracy is (40+930)/1,000=0.97, which looks strong but hides missed fraud. Precision=40/(40+10)=0.80. Recall=40/(40+20)=0.667. F1=2 x 0.80 x 0.667/(0.80+0.667)=0.727. Reasoning: with rare positives, accuracy is dominated by true negatives, so report precision, recall, and F1 and choose a threshold based on the cost of false negatives versus false positives.
Traps
Quoting accuracy alone on imbalanced data is the classic error. Scaling before splitting leaks validation information. Tuning hyperparameters on the test set inflates results. Confusing precision with recall also costs marks: precision is about predicted positives, recall about actual positives.