End-of-lesson Quiz
5 questions · Logistic Regression
1
of 5
Why can't we just use linear regression for a yes/no problem like 'is this URL phishing?'
A linear model can output -3.7 or 12.4 — meaningless as a probability. The sigmoid function in logistic regression squashes any real number into the [0, 1] range, so the output can be interpreted as P(phishing).
2
of 5
What does the sigmoid function output when its input
z is exactly 0?
σ(0) = 0.5 — the model is on the fence. This is the decision boundary: when the weighted features sum to zero, the model has no preference between the two classes.
3
of 5
A phishing URL uses HTTPS and has a valid certificate. Does
uses_https = 1 alone make it safe?
Most phishing sites now use free Let's Encrypt certificates. A single feature is rarely enough — that's why ML uses many features at once.
has_at_symbol, has_ip_address, num_hyphens, and url_length would all still flag a phishing URL even when HTTPS is on.
4
of 5
Your boss is excited about a model with 95% accuracy and 60% recall on phishing. Why are you not?
Recall is the metric that matters when missing a positive is dangerous. 60% recall on phishing means 40% slip through to inboxes — potentially thousands of users exposed to credential theft per day. Accuracy is misleading when classes are imbalanced.
5
of 5
You lower the classification threshold from 0.5 to 0.3. What happens?
Lowering the threshold means the model says 'phishing' more often. You catch more true phishing (recall up) but also flag more legitimate URLs (precision down). This is the precision-recall tradeoff — you tune the threshold to match your operational capacity.