This repository intend to apply different supervised learning approaches on credit card fraud detection (Kaggle dataset):
Credit Card Fraud Detection:
https://www.kaggle.com/mlg-ulb/creditcardfraud
The datasets contains transactions made by credit cards in September 2013 by european cardholders. This dataset presents transactions that occurred in two days, where we have 492 frauds out of 284,807 transactions. The dataset is highly unbalanced.
This dataset contain 285k x 31 columns
- Time: Number of seconds elapsed between this transaction and the first transaction in the dataset.
- V1 ... V28: A result of a PCA Dimensionality reduction to protect user identities and sensitive features.
- Amount: Transaction amount.
- Class: 1 for fraudulent transactions, 0 otherwise.
- After plotting Time and Amount Features it is obvious that there is no need to use Time feature so we can droped it.

- Oversample train data to eliminate Unbalanced data effect and to improve Models Performance.
- StandardScale Amount feature to eliminate scale effect because all the other features are standard scaled (A result of PCA).
In all approches 2 cases were studied:
- Original data.
- Oversampled data (to improve models performance).
- ROC-AUC: Compute Area Under the Receiver Operating Characteristic Curve (ROC AUC) from prediction scores.
- Recall: The recall is intuitively the ability of the classifier to find all the positive samples. it computes the ratio
True Positive/(True Positive+ False Negative)
| Original Data | Oversampled Data | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
From the above results it is obvous that:
- ROC-AUC and Recall scores in the case of original data are lower than the case of oversampled data in all approaches.
- Naîve bayes and Random forest have high ROC-AUC and Recall scores comparing them to other approaches.
- Gradient Boosting is the approach with the lower scores in the case of original data.
- Ensemble approaches (Random forest and gradient boosting) outperformed other approaches in the case of oversampled data specially Gradient Boosting approach.
- K-nearest neighbors is a good approach in this case.
