Credit Card Fraud Detection
The probability of something happening is denoted as:
Two independent events have a joint probability:
For example, if the probability of flipping a coin on heads once is 1/2 than the probability of flipping it twice and getting heads both times is:
The probability of the positive class y given some non-independent event x is denoted as:
Bayes' theorem relates the probability of the positive class to the likelihood and prior probability:
Question: I have a cough, what's the likelihood I have COVID-19?
Using Bayes' theorem:
Suppose:
Then:
Interpretation: Given that you have symptoms, there is a 22.5% probability that you have COVID-19.
Train/Test Split: Randomly remove 20% of the examples to evaluate the model's performance.
df_train = df.sample(frac=0.8)
df_test = df.drop(df_train.index)
or
df_train, df_test = train_test_split(df, test_size=0.2)
Accuracy: The proportion of correctly classified instances.
TODO include precision and recall in here