← Quiz: Logistic Regression from Scratch: all 10 questions
Quiz: Logistic Regression from Scratch · Question 7 of 10
What does this print? (code)
What does this print?
import numpy as np
p = np.array([0.2, 0.55, 0.8, 0.45])
print((p >= 0.5).astype(int).sum())
- A.1
- B.2
- C.3
- D.4
Answer & explanation
Correct answer: 2
Only 0.55 and 0.8 reach the threshold 0.5.
Can you get the rest right without peeking?
Take the timed Quiz: Logistic Regression from Scratch quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →