Detecting the fradulent credit card transactions
As we know, out of million transcation, 1000 transactions are being fradulent. So, when training a ML model to detect the fradulent credit card transactions, it is often difficult to find the dataset balanced. This is class imbalance and in the project, with the use of several ML algorithms, we tackle the problem of fradulent transactions. We foucs on model performance instead of model accuracy.
The dataset used in this project have 492 fraudulent transactions out of 284,807 transactions. The dataset is highly unbalanced, the positive class (frauds) account for only 0.172% of all transactions. The dataset is available for download at https://www.kaggle.com/mlg-ulb/creditcardfraud
- Logisitc regression
- Random Forest
- XGBoost classifier
These alogrithms are trained on original dataset and on dataset after performing Synthetic Minority Over-Sampling Technique(SMOTE) on the original dataset.
- F1 Score.
- Recall.
- Precision.
- Confusion Matrix
- Average precision-recall score.
- Average ROC_AUC score.
The Logistic Regression gives the best Recall score on the original dataset among the three algorithms. However, it lags the other two classifiers on all other metrics. XGBoost gives the best F1 score among the classifiers. Using the classifiers on the SMOTE dataset improves the Recall of the models at the cost of Precision and F1 Score.