Logistic Regression Q&A
20 Core Questions
Interview Prep
Logistic Regression: Interview Q&A
Short questions and answers on logistic regression for binary classification: sigmoid, decision boundary, regularization and evaluation.
Sigmoid
Odds & Log‑odds
Cross‑Entropy
Decision Boundary
1
What is logistic regression used for?
âš¡ Beginner
Answer: Logistic regression is mainly used for binary classification problems where the target has two classes (0/1).
2
Why is it called “regression†if it does classification?
âš¡ Beginner
Answer: It models the log‑odds of the probability as a linear function of inputs, which is a regression on a transformed target.
3
What does the sigmoid function do in logistic regression?
âš¡ Beginner
Answer: The sigmoid maps any real‑valued input to a value between 0 and 1, which is interpreted as a probability of the positive class.
4
What is the decision boundary in logistic regression?
âš¡ Beginner
Answer: It is the set of points where the predicted probability is 0.5; in feature space this corresponds to a linear boundary for standard logistic regression.
5
What loss function is commonly used to train logistic regression?
📊 Intermediate
Answer: Logistic regression is typically trained using log‑loss (binary cross‑entropy).
6
How do you interpret a logistic regression coefficient?
📊 Intermediate
Answer: A coefficient represents the change in log‑odds of the positive class for a one‑unit increase in that feature, holding others constant.
7
What is an odds ratio in this context?
📊 Intermediate
Answer: The odds ratio is the exponentiated coefficient (eáµ), showing how the odds multiply when the feature increases by one unit.
8
Why is feature scaling important for logistic regression with regularization?
📊 Intermediate
Answer: Scaling ensures that the regularization penalty treats all features fairly and helps solvers converge faster.
9
Can logistic regression handle non‑linear decision boundaries?
🔥 Advanced
Answer: Yes, by using feature engineering or kernels (e.g., polynomial features) you can get non‑linear decision boundaries.
10
How do you extend logistic regression to multi‑class problems?
🔥 Advanced
Answer: Common approaches are one‑vs‑rest (train one classifier per class) or using a softmax/multinomial logistic regression formulation.
11
What are some assumptions of logistic regression?
🔥 Advanced
Answer: Main assumptions: log‑odds are linear in features, observations are independent, and there is little severe multicollinearity.
12
How is overfitting controlled in logistic regression?
📊 Intermediate
Answer: Overfitting is controlled using L1 or L2 regularization, feature selection and proper cross‑validation.
13
Which evaluation metrics are usually used with logistic regression?
âš¡ Beginner
Answer: Common metrics include accuracy, precision, recall, F1‑score, ROC‑AUC and log‑loss.
14
Is logistic regression a generative or discriminative model?
🔥 Advanced
Answer: Logistic regression is a discriminative model; it directly models P(y|x) instead of the joint distribution of x and y.
15
How do you handle class imbalance with logistic regression?
📊 Intermediate
Answer: Techniques include using class weights, resampling (over/under‑sampling), changing the decision threshold and focusing on recall/F1.
16
Why is logistic regression often a strong baseline for classification?
âš¡ Beginner
Answer: It is simple, fast, interpretable and often performs surprisingly well with good features and regularization.
17
How do you check if the logit is roughly linear in features?
🔥 Advanced
Answer: You can use partial residual plots or transformation tests to see if relationships look approximately linear on the logit scale.
18
Are logistic regression probabilities calibrated by default?
🔥 Advanced
Answer: Logistic regression often produces reasonably calibrated probabilities, but calibration can still be checked and improved if needed.
19
Give a real‑world example where logistic regression is used.
âš¡ Beginner
Answer: Examples: spam detection, credit default prediction, churn prediction and many other yes/no decisions.
20
What is the main message to remember about logistic regression?
âš¡ Beginner
Answer: Logistic regression is a go‑to baseline for classification; understand its assumptions, how to regularize it and how to interpret its coefficients.
Quick Recap: Logistic Regression
If you can explain logistic regression clearly—what the sigmoid, odds, coefficients and metrics mean—you will be comfortable with many other classifiers too.