Interview Q&A / Machine Learning

INTERVIEW Q&A · 55 QUESTIONS

Machine Learning interview questions

Supervised vs unsupervised learning, overfitting, metrics and the classic models, explained simply.

  1. 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
  2. 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
  3. How does the K-Nearest Neighbours algorithm make a prediction?

    KNN stores all training data. To predict, it finds the k training points closest to the new point and takes a majority vote (classification) or an average (regression) of their targets.

    BeginnerQuick answer1 min read
  4. What is the difference between classification and regression?

    Classification predicts a category (spam or not spam, pass or fail). Regression predicts a continuous number (a house price, tomorrow's temperature). The choice depends on the type of the target column, not on the algorithm.

    BeginnerQuick answer1 min read