Interview Q&A / Machine Learning
Machine Learning interview questions
Supervised vs unsupervised learning, overfitting, metrics and the classic models, explained simply.
Prefer rapid revision? Practise Machine Learning short interview answers →
- Why do we split data into train, validation and test sets, and what is k-fold cross-validation?
The training set teaches the model, the validation set is used to choose settings, and the test set is kept untouched for a final, honest score. K-fold cross-validation splits data into k parts and trains k times, each time testing on a different part, giving a more reliable estimate when data is limited.
IntermediateIn-depth4 min read - How can scaling or imputing before the train-test split cause data leakage?
If you compute the mean or maximum on the full dataset, information from test rows leaks into training. Always fit scalers and imputers on the training set only, then apply them to the test set. A scikit-learn Pipeline does this automatically.
IntermediateQuick answer1 min read