Skills101
← All practice quizzes

Quiz: Logistic Regression from Scratch

5 questions · new set on every retakeNo time limitPass: 60%+10 XP on first pass

Build a yes/no classifier with NumPy alone: why a straight line fails for probabilities, the sigmoid function, log loss, training with gradient descent, choosing a decision threshold, and reading the weights as odds.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    Why is a plain straight line a poor model for a yes/no target?

  2. Question 2

    What is sigmoid(0)?

  3. Question 3

    What does this print?

    import math
    p = 0.5
    print(round(-math.log(p), 3))
    
  4. Question 4

    A student cleared the test, but the model said p = 0.01. How do log loss and squared error compare?

  5. Question 5

    In logistic regression trained with log loss, what is the gradient for the weight w?

🎯 Today’s placement challenge — 10 questions, no login. Can you score 10/10?Take today’s challenge →