Data Science Supervised Learning Models 2 — Questions and Answers
Question 1: In a logistic regression model, what does the sigmoid function output represent?
- A probability between 0 and 1 (Correct answer)
- A raw class label
- The residual error
- The feature variance
Correct answer: A probability between 0 and 1
The sigmoid squashes the linear combination into a value between 0 and 1 interpreted as a probability.
Question 2: Which loss function is most appropriate for a binary classification task?
- Binary cross-entropy (Correct answer)
- Mean squared error
- Mean absolute error
- Huber loss
Correct answer: Binary cross-entropy
Binary cross-entropy penalizes confident wrong predictions and suits probabilistic binary outputs.
Question 3: What is the primary purpose of regularization (L1/L2) in supervised models?
- Reduce overfitting by penalizing large weights (Correct answer)
- Increase training accuracy
- Speed up gradient computation
- Balance class labels
Correct answer: Reduce overfitting by penalizing large weights
Regularization adds a penalty on coefficient magnitude to discourage overly complex models that overfit.
Question 4: Which model uses a margin-maximizing hyperplane to separate classes?
- Support Vector Machine (Correct answer)
- K-Means
- Naive Bayes
- Linear regression
Correct answer: Support Vector Machine
SVMs find the hyperplane that maximizes the margin between the nearest points of each class.
Question 5: In a decision tree, what does the Gini impurity measure?
- Probability of misclassifying a randomly chosen sample (Correct answer)
- Depth of the tree
- Number of leaf nodes
- Feature correlation
Correct answer: Probability of misclassifying a randomly chosen sample
Gini impurity quantifies how often a randomly labeled sample would be misclassified at a node.
Question 6: What distinguishes a supervised model from an unsupervised one?
- It trains on labeled target values (Correct answer)
- It requires no data
- It only clusters data
- It cannot make predictions
Correct answer: It trains on labeled target values
Supervised learning uses input-output pairs with known labels to learn a mapping.
Question 7: Which metric is best for evaluating a classifier on an imbalanced dataset?
- F1 score (Correct answer)
- Raw accuracy
- Total training time
- Number of features
Correct answer: F1 score
The F1 score balances precision and recall, making it robust when classes are imbalanced.
In a logistic regression model, what does the sigmoid function output represent?