Home »
MCQs
Logistic Regression MCQs (Multiple-Choice Questions)
Logistic Regression is a supervised machine learning algorithm primarily used for classification problems. It estimates the probability of an outcome by applying the sigmoid function to a linear combination of input features.
Logistic Regression MCQs
These Logistic Regression MCQs cover important concepts such as classification, sigmoid function, probability, log-odds, decision thresholds, log loss, regularization, model training, prediction, multiclass classification, and implementing Logistic Regression using Python and scikit-learn.
List of Logistic Regression MCQs
The following Logistic Regression multiple-choice questions are useful for students, machine learning learners, Python programmers, and candidates preparing for technical examinations and interviews.
1. What type of machine learning problem is Logistic Regression primarily used for?
- Classification
- Clustering
- Dimensionality reduction
- Association rule mining
Answer: A) Classification
Explanation:
Logistic Regression is primarily used to model classification outcomes by estimating the probability of an event or class.
2. What does Logistic Regression typically predict before applying a classification threshold?
- A probability
- A database record
- A cluster identifier
- A text document
Answer: A) A probability
Explanation:
Logistic Regression produces a probability between 0 and 1, which can then be converted into a class using a threshold.
3. Which function is used by Logistic Regression to transform the linear model output into a probability?
- Sigmoid function
- ReLU function
- Step function only
- Cosine function
Answer: A) Sigmoid function
Explanation:
The sigmoid function transforms the linear output into a value strictly between 0 and 1, allowing it to be interpreted as a probability.
4. What is the mathematical form of the standard sigmoid function?
1 / (1 + e^-x)
1 / (1 - e^-x)
e^x + 1
x / (1 + e)
Answer: A) 1 / (1 + e^-x)
Explanation:
The standard sigmoid function is defined as 1 divided by 1 plus e raised to the negative input. Its output is always greater than 0 and less than 1.
5. What is the output of the sigmoid function when its input is 0?
- 0
- 0.25
- 0.5
- 1
Answer: C) 0.5
Explanation:
For an input of 0, the sigmoid function evaluates to 1 divided by 2, which is 0.5.
6. What is the range of the standard sigmoid function?
- Less than -1 to greater than 1
- 0 to 1, inclusive
- Greater than 0 and less than 1
- -1 to 1
Answer: C) Greater than 0 and less than 1
Explanation:
The sigmoid function approaches 0 and 1 but does not actually reach either value for finite inputs.
7. In Logistic Regression, what does the linear combination of features represent before applying the sigmoid function?
- The log-odds
- The final class label
- The confusion matrix
- The accuracy score
Answer: A) The log-odds
Explanation:
The linear expression consisting of the bias and weighted features represents the log-odds, which is then passed through the sigmoid function.
8. Which equation represents the linear component of a Logistic Regression model?
z = b + w1x1 + w2x2 + ... + wNxN
z = x1 / x2
z = x1² + x2²
z = sin(x)
Answer: A) z = b + w1x1 + w2x2 + ... + wNxN
Explanation:
The linear component combines the bias with the weighted input features. The resulting value is passed to the sigmoid function.
9. What does the parameter b generally represent in the Logistic Regression equation?
- Bias
- Batch size
- Binary label
- Baseline accuracy
Answer: A) Bias
Explanation:
The parameter b represents the bias or intercept of the linear component of the Logistic Regression model.
10. What do the parameters w1, w2, and other w values represent?
- Learned feature weights
- Class labels
- Probability thresholds
- Loss values
Answer: A) Learned feature weights
Explanation:
The weights determine how strongly individual features contribute to the linear model output.
11. What is log-odds?
- The logarithm of the odds of an event
- The average model accuracy
- The logarithm of the number of features
- The difference between training and test loss
Answer: A) The logarithm of the odds of an event
Explanation:
Log-odds is the natural logarithm of the ratio between the probability of an event and the probability of its complement.
12. If the predicted probability of an event is 0.8, what are the odds of the event?
- 0.2
- 0.8
- 4
- 5
Answer: C) 4
Explanation:
The odds are calculated as p divided by 1-p. For p = 0.8, the odds are 0.8 / 0.2 = 4.
13. Which probability corresponds to odds of 1?
- 0.1
- 0.25
- 0.5
- 0.9
Answer: C) 0.5
Explanation:
When the probability of an event equals the probability of its complement, the odds are 0.5 / 0.5 = 1.
14. What happens to the sigmoid output as its input becomes very large and positive?
- It approaches 0
- It approaches 0.5
- It approaches 1
- It becomes negative
Answer: C) It approaches 1
Explanation:
As the input to the sigmoid becomes increasingly positive, the output approaches 1 without reaching it for a finite input.
15. What happens to the sigmoid output as its input becomes very large and negative?
- It approaches 0
- It approaches 0.5
- It approaches 1
- It becomes greater than 1
Answer: A) It approaches 0
Explanation:
As the input becomes increasingly negative, the sigmoid output approaches 0 without reaching it for a finite input.
16. What is the predicted probability when the log-odds value z is 1?
- Approximately 0.119
- Approximately 0.269
- Approximately 0.731
- Approximately 0.982
Answer: C) Approximately 0.731
Explanation:
Applying the sigmoid function to z = 1 gives approximately 0.731.
17. What is the purpose of a classification threshold in Logistic Regression?
- To convert a predicted probability into a class
- To calculate the number of features
- To normalize every feature
- To calculate the training dataset size
Answer: A) To convert a predicted probability into a class
Explanation:
A probability produced by Logistic Regression can be converted into a binary class by comparing it with a selected threshold.
18. If a binary classifier uses a threshold of 0.5, what class is commonly predicted when the probability is 0.8?
- Positive class
- Negative class
- Unknown class
- Training class
Answer: A) Positive class
Explanation:
With a threshold of 0.5, a predicted probability of 0.8 is above the threshold and is therefore assigned to the positive class under the usual binary-classification convention.
19. What is the primary loss function associated with binary Logistic Regression?
- Log Loss
- Mean absolute error only
- Hinge loss only
- Euclidean distance
Answer: A) Log Loss
Explanation:
Binary Logistic Regression commonly uses log loss, also known as logistic loss or cross-entropy loss.
20. Why is log loss useful for Logistic Regression?
- It measures the quality of probabilistic predictions
- It converts features into strings
- It removes all features from the model
- It guarantees 100% accuracy
Answer: A) It measures the quality of probabilistic predictions
Explanation:
Log loss evaluates how close predicted probabilities are to the actual binary labels and strongly penalizes confident incorrect predictions.
21. What happens to log loss when a model makes a very confident incorrect prediction?
- The loss can become very large
- The loss always becomes zero
- The loss becomes negative
- The loss becomes exactly 0.5
Answer: A) The loss can become very large
Explanation:
Log loss heavily penalizes predictions that assign very high probability to the wrong class.
22. What is the target label convention used in binary Logistic Regression's standard log-loss formula?
- Labels are represented as 0 or 1
- Labels must always be -1 or 1
- Labels must be text strings
- Labels must be floating-point values greater than 1
Answer: A) Labels are represented as 0 or 1
Explanation:
In the standard binary log-loss formulation, the target label y takes values 0 or 1.
23. Why is regularization used in Logistic Regression?
- To help reduce overfitting
- To increase the number of labels automatically
- To remove the sigmoid function
- To convert classification into clustering
Answer: A) To help reduce overfitting
Explanation:
Regularization constrains model parameters and can help improve generalization by reducing overfitting. Google emphasizes the importance of regularization when training Logistic Regression models.
24. Which of the following is a common type of regularization used with Logistic Regression?
- L2 regularization
- JPEG regularization
- HTML regularization
- Binary tree regularization
Answer: A) L2 regularization
Explanation:
L2 regularization adds a penalty related to the squared magnitude of model weights and is commonly used with Logistic Regression.
25. Which regularization technique can produce sparse model coefficients?
- L1 regularization
- L2 regularization only
- No regularization
- Batch normalization
Answer: A) L1 regularization
Explanation:
L1 regularization can drive some coefficients to exactly zero, which can result in a sparse model.
26. Which Python library provides a commonly used Logistic Regression implementation?
- scikit-learn
- Beautiful Soup
- Flask
- Requests
Answer: A) scikit-learn
Explanation:
scikit-learn provides Logistic Regression through sklearn.linear_model.LogisticRegression.
27. Which import statement is used to import Logistic Regression from scikit-learn?
from sklearn.linear_model import LogisticRegression
from sklearn.logistic import Regression
import sklearn.LogisticRegression
from sklearn.classification import Logistic
Answer: A) from sklearn.linear_model import LogisticRegression
Explanation:
In scikit-learn, the LogisticRegression estimator is located in the sklearn.linear_model module.
28. Which method is commonly used to train a scikit-learn Logistic Regression model?
fit()
train()
learn()
build()
Answer: A) fit()
Explanation:
scikit-learn estimators are generally trained using the fit() method with feature data and target labels.
29. Which method is commonly used to obtain class predictions from a trained scikit-learn Logistic Regression model?
predict()
classify()
estimate()
class()
Answer: A) predict()
Explanation:
The predict() method produces predicted class labels for input samples.
30. Which method can be used with scikit-learn Logistic Regression to obtain predicted probabilities?
predict_proba()
predict_probability()
probability()
get_probability()
Answer: A) predict_proba()
Explanation:
scikit-learn's predict_proba() method returns estimated class probabilities for supported classifiers, including Logistic Regression.
31. Which attribute of a trained scikit-learn Logistic Regression model contains the learned coefficients?
coef_
weights
parameters
coefficients
Answer: A) coef_
Explanation:
scikit-learn stores the learned feature coefficients of Logistic Regression in the coef_ attribute.
32. Which attribute stores the intercept learned by scikit-learn Logistic Regression?
intercept_
bias
offset
constant
Answer: A) intercept_
Explanation:
The intercept_ attribute contains the learned intercept term of the fitted Logistic Regression model.
33. What does the C parameter control in scikit-learn Logistic Regression?
- The inverse of regularization strength
- The number of classes only
- The number of input features
- The classification threshold
Answer: A) The inverse of regularization strength
Explanation:
In scikit-learn, a smaller C means stronger regularization, while a larger C means weaker regularization.
34. What is the default regularization penalty in the current scikit-learn LogisticRegression documentation?
- L1
- L2
- Elastic Net
- None
Answer: B) L2
Explanation:
The current scikit-learn documentation lists L2 as the default penalty for LogisticRegression.
35. Which solver supports Elastic-Net regularization in scikit-learn Logistic Regression?
- saga
- liblinear only
- lbfgs only
- newton-cg only
Answer: A) saga
Explanation:
According to the current scikit-learn documentation, Elastic-Net regularization is supported by the saga solver.
36. Which solver in scikit-learn supports L1 and L2 regularization but not Elastic-Net?
- liblinear
- lbfgs
- newton-cg
- sag
Answer: A) liblinear
Explanation:
The current documentation states that the liblinear solver supports L1 and L2 regularization, but not Elastic-Net.
37. Can Logistic Regression be used for multiclass classification?
- Yes
- No, never
- Only with regression targets
- Only without features
Answer: A) Yes
Explanation:
Logistic Regression can be extended to multiclass classification. scikit-learn supports multiclass Logistic Regression with several solvers.
38. Which situation represents binary classification?
- Predicting whether an email is spam or not spam
- Predicting one of ten unrelated categories
- Grouping customers without labels
- Reducing 100 features to two dimensions
Answer: A) Predicting whether an email is spam or not spam
Explanation:
Binary classification involves choosing between two classes, such as spam and not spam.
39. Which problem is an example of multiclass classification?
- Predicting whether a message is spam or not spam
- Predicting whether a customer will buy or not buy
- Classifying an image as cat, dog, bird, or horse
- Predicting house price
Answer: C) Classifying an image as cat, dog, bird, or horse
Explanation:
A multiclass problem contains more than two possible classes. The example contains four possible categories.
40. What is overfitting in Logistic Regression?
- When the model learns patterns specific to training data and generalizes poorly
- When the model has no features
- When the sigmoid function is removed
- When every prediction is exactly 0.5
Answer: A) When the model learns patterns specific to training data and generalizes poorly
Explanation:
Overfitting occurs when a model fits the training data too closely and performs poorly on previously unseen data.
41. Which technique can help control overfitting in Logistic Regression?
- Regularization
- Removing the target labels
- Increasing every coefficient without restriction
- Using random class names
Answer: A) Regularization
Explanation:
Regularization penalizes large model coefficients and can help a Logistic Regression model generalize better to unseen data.
42. What does a positive Logistic Regression coefficient generally indicate?
- An increase in the feature is associated with increased log-odds of the modeled positive outcome, holding other features constant
- The feature is always irrelevant
- The probability must equal 0
- The model is necessarily overfitting
Answer: A) An increase in the feature is associated with increased log-odds of the modeled positive outcome, holding other features constant
Explanation:
A positive coefficient increases the linear predictor and therefore increases the modeled log-odds of the positive outcome when other features are held constant.
43. What does a negative Logistic Regression coefficient generally indicate?
- An increase in the feature is associated with decreased log-odds of the modeled positive outcome, holding other features constant
- The feature is always removed
- The probability becomes exactly zero
- The model must be underfitting
Answer: A) An increase in the feature is associated with decreased log-odds of the modeled positive outcome, holding other features constant
Explanation:
A negative coefficient decreases the linear predictor and therefore decreases the modeled log-odds of the positive outcome when other features remain constant.
44. What is a decision boundary in Logistic Regression?
- A boundary separating predicted classes according to a classification rule
- The training dataset itself
- The model's loss history
- The list of feature names
Answer: A) A boundary separating predicted classes according to a classification rule
Explanation:
A decision boundary separates regions of feature space that are assigned to different classes according to the model and selected classification threshold.
45. What happens when the classification threshold is increased for a binary classifier?
- It generally becomes harder for examples to be classified as positive
- Every example becomes positive
- The sigmoid function is removed
- The number of features automatically increases
Answer: A) It generally becomes harder for examples to be classified as positive
Explanation:
A higher threshold requires a larger predicted probability before an example is assigned to the positive class. This generally reduces positive predictions.
46. Which metric measures the proportion of predicted positive examples that are actually positive?
- Precision
- Recall
- Specificity
- Mean squared error
Answer: A) Precision
Explanation:
Precision measures how many of the examples predicted as positive are actually positive.
47. Which metric measures the proportion of actual positive examples that are correctly identified?
- Recall
- Precision
- Mean absolute error
- R-squared
Answer: A) Recall
Explanation:
Recall measures the proportion of actual positive examples that the classifier correctly identifies as positive. Google discusses recall as one of the key metrics for binary classification.
48. Which metric can be misleading when a binary classification dataset is highly imbalanced?
- Accuracy
- Recall
- Precision
- F1 score
Answer: A) Accuracy
Explanation:
Accuracy can appear very high when one class dominates the dataset, even if the model performs poorly on the minority class.
49. Which statement best describes Logistic Regression in Python?
- It is a machine learning algorithm that can be implemented using Python libraries such as scikit-learn
- It is a Python programming language feature
- It is a Python syntax rule
- It is a Python package manager
Answer: A) It is a machine learning algorithm that can be implemented using Python libraries such as scikit-learn
Explanation:
Logistic Regression is a machine learning algorithm, not a Python-specific technology. Python libraries such as scikit-learn provide implementations for using it in Python programs.
50. Which statement best describes Logistic Regression?
- It estimates probabilities for classification using a sigmoid transformation of a linear model
- It is an unsupervised clustering algorithm
- It is a database indexing algorithm
- It is a programming language compiler
Answer: A) It estimates probabilities for classification using a sigmoid transformation of a linear model
Explanation:
Logistic Regression combines a linear model with the sigmoid function to produce probabilities that can be used for classification.
Advertisement
Advertisement