Checkpoint
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
Flip the conditional the reliable way: by counting. Out of 10,000 transactions with a 2% fraud base rate, the detector alerts on 90% of fraud and 5% of legitimate traffic. Count the fraud cases, the legit cases, the alerts each group produces (use int() on each count), then compute P(fraud | alert) = fraud alerts / all alerts. Print the total alerts, the probability (:.1%), and whether most alerts are false alarms.