lesson 2 of 5 · probability and baselines before modelslesson 2 of 5 · probability and baselines before modelslesson 2 of 5 · probability and baselines before modelslesson 2 of 5 · probability and baselines before modelslesson 2 of 5 · probability and baselines before modelslesson 2 of 5 · probability and baselines before modelslesson 2 of 5 · probability and baselines before modelslesson 2 of 5 · probability and baselines before modelslesson 2 of 5 · probability and baselines before modelslesson 2 of 5 · probability and baselines before modelslesson 2 of 5 · probability and baselines before models
Checkpoint
One last thing before we move on. pass this to mark the lesson done, or skip and keep moving. hop to the next when you're ready.
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.