Intermediate to advanced questions on ML concepts, algorithms and model evaluation.
Fundamentals
What is the difference between supervised and unsupervised learning?
Supervised learning trains on labelled data to predict outcomes. Unsupervised learning finds hidden patterns or structure in data that has no labels.
What is the difference between classification and regression?
Classification predicts discrete labels, such as spam or not spam. Regression predicts continuous values, such as a house price.
Explain the bias-variance tradeoff.
Bias is error from assumptions that are too simple; variance is error from a model that is too complex and sensitive to the training data. A good model balances the two to minimise total error.
What is overfitting and how can you prevent it?
Overfitting is when a model learns the noise in the training data instead of the underlying pattern. Prevent it with cross-validation, regularisation, pruning, more data or a simpler model.
Evaluation
What are precision, recall and F1-score?
Precision is TP / (TP + FP). Recall is TP / (TP + FN). The F1-score is the harmonic mean of precision and recall. All three measure classification performance.
Algorithms
What is the difference between bagging and boosting?
Bagging trains several independent models in parallel and averages their predictions. Boosting trains models one after another, each trying to correct the errors of the previous one.
How does a decision tree split data?
At each node it picks the split that makes the child nodes as pure as possible, measured with metrics such as the Gini index or information gain.
How does k-nearest neighbours (KNN) work?
KNN labels a point by majority vote among its k nearest neighbours, using a distance such as Euclidean. There is no training phase, but each prediction costs O(n).
How do support vector machines (SVM) work?
An SVM finds the hyperplane that maximises the margin between classes. The kernel trick lets it handle non-linear data by mapping it into higher dimensions.
What is the difference between L1 and L2 regularisation?
L1 (Lasso) adds the absolute values of the coefficients and can shrink some to zero, which acts as feature selection. L2 (Ridge) adds the squared values and shrinks coefficients without removing any.
Related: hire machine learning engineers, the machine learning engineer salary guide and data scientist interview questions.
Keep reading
Same skill, other angles

