WorksheetsLogistic Regression Quiz
Total questions: 30
Worksheet time: 15mins
What is the primary purpose of logistic regression in binary classification networks?
To model the relationship between a categorical response variable and explanatory variables
To calculate the mean of a dataset
To sort data in ascending order
To find the maximum value in a dataset
In logistic regression, what is the typical range for the output probability variable?
0 to 10
-1 to 1
0.0 to 1.0
1 to 100
Why is logistic regression especially useful when the response variable has only two possible outcomes?
It can handle multiple classes easily
It can model probabilities for binary outcomes
It is faster than other algorithms
It does not require any input variables
What is the purpose of the sigmoid activation function in logistic regression single-layer networks?
To map z to a float bounded between 0.0 and 1.0
To increase the learning rate
To reduce the number of parameters
To make the network deeper
Which of the following is the correct formula for the sigmoid activation function?
y = 1+e−z1
y=z2+b
y=wTx+b
y = log(z)
Which function is commonly used as the loss function in a logistic regression model for binary classification?
Mean Squared Error (MSE)
Binary Cross-Entropy (BCE)
Hinge Loss
Categorical Cross-Entropy
What is the purpose of minimizing the loss function in logistic regression?
To increase the number of input variables
To estimate the values of the parameters
To reduce the number of output variables
To increase the training sample size
What does the output variable $ y $ represent in a logistic regression model?
A categorical value between 1 and 10
A float value between 0 and 1
An integer value only
A binary value of 0 or 2
What is the formula for the gradient of the output yn with respect to zn for the sigmoid activation function?
yn+(1−yn)
yn−(1−yn)
If the output of the sigmoid function is , which of the following is true about its derivative with respect to its input?
It is always positive and less than 1
It is always negative
It is always greater than 1
It is always zero
According to the provided equations, what does the gradient of the loss function with respect to the bias variable $ b $ equal?
(yn−tn)
(yn−tn)xin
yn(1−yn)xin
(yn−tn)xi
Which parameter in the gradient descent update equations represents the learning rate?
η
w
b
N
What is the purpose of estimating the values of the w and b parameters in a learning algorithm for classification?
To estimate the output of the learning algorithm
To define the threshold for decision
To use them at test time for prediction
To calculate the loss function
Which of the following equations represents the linear decision boundary of logistic regression for two-dimensional data?
w₁x₁ + w₂x₂ + b = 0
w₁x₁ + w₂x₂ = 1
w₁x₁ - w₂x₂ + b = 0
w₁x₁ + w₂x₂ - b = 0
According to the document, what is the value of the probability P(y = 1|x) at the decision boundary?
0
1
0.5
2
In the context of ROC curves, what does the Area Under the Curve (AUC) evaluate?
The model's ability to minimize false positives
The model's ability to distinguish between classes across various threshold settings
The model's ability to maximize true negatives
The model's ability to increase recall only
Given the formulas for TPR and FPR, which of the following is correct for FPR?
FPR = FP / (FP + TN)
FPR = TP / (TP + FN)
FPR = TN / (TN + FP)
FPR = TP / (TP + FP)
What is the purpose of initializing variables for TPR and FPR at (0, 0) on the ROC curve?
To start plotting the ROC curve from the origin
To maximize the AUC
To minimize the error rate
To calculate the F1-score
Which of the following best describes the formula for AUC given in the text?
It computes the area for each trapezoid under the ROC curve and sums them up
It calculates the mean squared error
It finds the maximum value of TPR
It multiplies precision and recall
Which of the following statements best describes an AUC value of 1 in an ROC curve?
The classifier is making random guesses.
The classifier is a perfect classifier.
The classifier cannot separate positive and negative classes.
The classifier labels all negative instances as positive.
What does an AUC value of 0.5 indicate about a classifier's performance?
The classifier is a perfect classifier.
The classifier is making random guesses.
The classifier is likely to effectively separate positive and negative classes.
The classifier labels all positive instances as negative.
According to the provided code, what is the purpose of the variable 'thresholds'?
To store the predicted probabilities.
To define the range of values for calculating TPR and FPR.
To store the true labels of the data.
To calculate the area under the ROC curve.
What is the first step in generating the F1 Curve according to the material?
Calculate the confusion matrix
Split the dataset into training, development, and test sets
Set the threshold to 0.5
Plot the ROC curve
According to the provided table, at which threshold value does the F1 score reach its maximum?
0.2
0.4
0.6
0.9
What is the purpose of the sigmoid function in the provided Python code example?
To map input values to a range between 0 and 1
To calculate the mean squared error
To initialize the weights
To plot the decision boundary
What is the value of the learning rate (alpha) used in the logistic regression example?
0.01
0.1
1.0
0.001
Which of the following best describes the purpose of the Python code provided in Listing 5.2?
To plot the F1 score against thresholds using a binary classifier's probability predictions.
To train a neural network for image classification.
To calculate the mean squared error for regression.
To visualize clustering results.
Why is maximizing the F1 score particularly effective in classifier performance evaluation?
Because it balances both precision and recall.
Because it only considers accuracy.
Because it ignores false positives.
Because it maximizes the number of predictions.
What insight does adjusting the decision threshold provide in classifier behavior?
It shows how the balance between precision and recall changes.
It increases the number of features in the model.
It reduces the training time.
It eliminates the need for validation data.
What does the truth table for the two-dimensional AND gate illustrate?
The output is 1 only when both x1 and x2 are 1.
The output is 1 when either x1 or x2 is 1.
The output is always 0.
The output alternates between 0 and 1.
