Last updated: 29th Nov, 2023
This page lists down the practice tests / interview questions and answers for Logistic regression in machine learning. Those wanting to test their machine learning knowledge in relation with logistic regression would find these practice tests very useful. The goal for these practice tests is to help you check your knowledge in logistic regression machine learning models from time-to-time. More importantly, when you are preparing for interviews, these practice tests are intended to be handy enough. Those going for freshers / intern interviews in the area of machine learning would also find these practice tests / interview questions to be very helpful.
These test primarily focus on following concepts related with logistic regression:
- Types of logistic regression (Binomial, Multinomial, Ordinal)
- Logistic function, logit transformation
- Evaluation of logistic regression (AIC, Deviance calculations)
- Classification problems examples where logistic regression can be applied
Logistic Regression Concepts
- Logistic Regression for Discrete Outcomes: Logistic regression is used to estimate/predict the discrete-valued output such as success or failure, 0 or 1, etc.
- Binary and Multinomial Classification: Logistic regression can be used for binary classification as well multinomial classification – classifying data in multiple classes.
- Softmax Classifier: In logistic regression, the term “softmax classifier” specifically refers to the multinomial logistic regression, where the softmax function is used to handle multiple classes. You may want to check out my post on What’s Softmax function and why do we need it?
- Gradient Descent and Cross-Entropy Loss: Logistic regression classifier is trained by applying gradient descent on the cross-entropy loss function. In other words, the weights of the logistic regression classifier are learned using gradient descent algorithm and cross-entropy loss function. You may want to check my post on Cross-entropy loss explained with Python examples.
- Cost Function and Log Loss: The cost function of logistic regression is derived from taking the log of the maximum likelihood function and applying negative to log loss function in order to use gradient descent for optimization purposes. This is why the cross-entropy loss function is also called a log loss function.
- Types of logistic regression model
- Binomial Logistic Regression: Used when the dependent variable has two possible outcomes, like ‘success’ or ‘failure’.
- Multinomial Logistic Regression: Applies when the outcome variable has more than two unordered categories, like ‘type of fruit’.
- Ordinal Logistic Regression: Suitable for dependent variables with ordered categories, such as ‘satisfaction rating’.
- Logistic regression model is evaluated using some of the following:
- AIC (Akaike Information Criterion): AIC is a statistical measure used to compare different statistical models. It balances model complexity against goodness of fit. Lower AIC values indicate a better model, considering both the likelihood of the model and the number of parameters used. It helps in model selection.
- Deviance (Null and Residual): In statistical modeling, deviance measures the difference between a fitted model and a saturated model. Null deviance shows this difference for a model with only the intercept, reflecting the model’s fit if no predictors are used. Residual deviance shows the difference after fitting the model with predictors.
- ROC Curve (Receiver Operating Characteristic Curve): The ROC curve is a graphical representation used in binary classification to assess the performance of a model. It plots the true positive rate against the false positive rate at various threshold settings. The area under the curve (AUC) indicates the model’s accuracy.
- Hosmer-Lemeshow Test: This test is used to evaluate the goodness of fit for logistic regression models. It compares observed event rates with predicted probabilities in subgroups of the dataset, providing a measure of how well the model predicts outcomes. A high p-value suggests a good fit.
- Pseudo R-squared: Pseudo R-squared values are used in logistic regression as counterparts to R-squared in linear regression. They provide an indication of the model’s explanatory power. Different versions (McFadden, Cox and Snell, etc.) measure this in slightly different ways, none of which can be interpreted as the proportion of variance explained as in linear regression.
In case you have not scored good enough, it may be good idea to go through basic machine learning concepts in relation with logistic regression. Following is the list of some my related blog pages:
Practice Test / Interview Questions & Answers
#1. Estimation in logistic regression chooses the parameters that ___________ the likelihood of observing the sample values.
#2. When using logistic regression for a binary classification problem, if the output of the model is 0.75 for a given observation, this means:
#3. ______ the value of AUC, better is the prediction power of the model.
#4. Which of the following can be used to evaluate the performance of logistic regression model?
#5. How much marks a student can get in a competitive exam based on hours of study can be solved using _________ regression model
#6. Given two model with different AIC value, which one would be preferred model?
#7. In the context of logistic regression, what does the term “odds ratio” refer to?
#8. Whether a student will pass or fail in the competitive exam based on hours of study can be solved using _________ regression model
#9. An AUC-ROC value of 0.5 indicates that the model's ability to discriminate between positive and negative classes is:
#10. The odds of the dependent variable equaling a case (given some linear combination x of the predictors) is equivalent to _______
#11. Which of the following is used to identify the best threshold for separating positive and negative classes?
#12. If the model deviance is significantly ________ than the null deviance, then one can conclude that the predictor or set of predictors significantly improved model fit.
#13. ROC related with ROC curve stands for _______
#14. Which of the following metrics is equal to True Positive / (True positive + False Positive)
#15. Regression coefficients in logistic regression are estimated using ________
#16. ROC curve is a plot of __________ vs ___________
#17. ________ regression can be termed as a special case of _________ regression when the outcome variable is categorical
#18. Which of the following tests can be used to assess whether the logistic regression model is well calibrated?
#19. Logistic regression is _________ when the observed outcome of dependent variable can have only two values such as 0 and 1 or success and failure
#20. Which of the following is analogous to R-Squared for logistic regression?
#21. Which of the following can be used to evaluate the performance of logistic regression model?
#22. Deviance is is a function of _________
#23. Logistic regression is _________ when the observed outcome of dependent variable are ordered
#24. Deviance can be shown to follow __________
#25. ______ value of deviance represents the better fit of model
#26. Logistic regression is _________ when the observed outcome of dependent variable can have multiple possible types
#27. Which of the following is link function in logistic regression?
#28. In the context of logistic regression, if a model has a deviance much larger than its degrees of freedom, this typically indicates:
#29. Which of the following metrics is equal to True Positive / (True positive + False Negative)
#30. In a logistic regression model, if the odds ratio for a predictor variable is less than 1, this suggests that:
#31. Logistic Regression uses Softmax function for which of the following?
#32. In the context of model comparison, if the difference in deviance between a more complex model and a simpler model is statistically significant, this suggests:
#33. If the ROC curve of a model is closer to the top-left corner of the plot, it indicates:
#34. Which of the following is an application of logistic regression?
Results
- Agentic Reasoning Design Patterns in AI: Examples - October 18, 2024
- LLMs for Adaptive Learning & Personalized Education - October 8, 2024
- Sparse Mixture of Experts (MoE) Models: Examples - October 6, 2024
- Agentic Reasoning Design Patterns in AI: Examples - October 18, 2024
- LLMs for Adaptive Learning & Personalized Education - October 8, 2024
- Sparse Mixture of Experts (MoE) Models: Examples - October 6, 2024
- Agentic Reasoning Design Patterns in AI: Examples - October 18, 2024
- LLMs for Adaptive Learning & Personalized Education - October 8, 2024
- Sparse Mixture of Experts (MoE) Models: Examples - October 6, 2024
I found it very helpful. However the differences are not too understandable for me