Data Science & ML

Supervised ML: Classification

Logistic regression, KNN, SVM, metrics (accuracy, precision, recall, F1, ROC-AUC), thresholds

24 interview questions·
Mid-Level
1

What is the main objective of a supervised classification algorithm?

Answer

Supervised classification aims to predict a category or class (discrete variable) from input features, by learning from labeled data. Unlike regression which predicts continuous values, classification assigns each observation to a predefined class (binary or multiclass).

2

Which mathematical function does logistic regression use to transform predictions into probabilities?

Answer

The sigmoid (or logistic) function transforms any real value into a probability between 0 and 1. It is defined as sigma(z) = 1/(1+e^(-z)). This function allows interpreting the output as the probability of belonging to the positive class.

3

What do the coefficients represent in a logistic regression model?

Answer

Logistic regression coefficients represent the change in log-odds for each unit change in the corresponding feature. A positive coefficient increases the probability of the positive class, while a negative coefficient decreases it. The exponential of the coefficient gives the odds ratio.

4

How does the K-Nearest Neighbors (KNN) algorithm work for classification?

5

What is the impact of choosing the value of k in the KNN algorithm?

6

Why is it important to normalize features before using KNN?

+21 interview questions

Master Data Science & ML for your next interview

Access all questions, flashcards, technical tests and interview simulators.

Start for free