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 →
- What are precision, recall and F1 score, and why can accuracy be misleading?
Precision is how many predicted positives were actually positive. Recall is how many actual positives the model found. F1 is their harmonic mean. On imbalanced data, a model can get high accuracy by always predicting the majority class while missing every case you care about.
BeginnerIn-depth4 min read - What is gradient descent, and what happens if the learning rate is too high or too low?
Gradient descent trains a model by repeatedly nudging its weights in the direction that reduces the loss fastest, which is opposite to the gradient. The learning rate sets the step size. Too small and training is very slow; too large and it overshoots the minimum and can bounce around or diverge.
BeginnerIn-depth4 min read - What is overfitting and underfitting, and what is the bias-variance trade-off?
Overfitting means the model memorises the training data, including noise, so it does well in training but badly on new data. Underfitting means the model is too simple to learn the pattern at all. The bias-variance trade-off is the balance between these two errors.
BeginnerIn-depth4 min read - What is the difference between linear regression and logistic regression?
Linear regression predicts a continuous number, like a house price, by fitting a straight line. Logistic regression predicts the probability of a class, like spam or not spam, by passing a linear score through the sigmoid function so the output stays between 0 and 1.
BeginnerIn-depth4 min read - What is the difference between supervised, unsupervised and reinforcement learning?
Supervised learning trains on examples that come with the correct answer (labels). Unsupervised learning finds patterns in data with no labels, such as groups. Reinforcement learning trains an agent by trial and error, using rewards and penalties from an environment.
BeginnerIn-depth4 min read