Introduction
Credit card fraud is a pervasive problem that affects both consumers and financial institutions. With the increase in online transactions, the risk of fraud has also increased. In this project, we aimed to develop a model to detect credit card fraud using machine learning techniques.
Dataset Description
This represents a fraud rate of 0.172%. The data was highly unbalanced, with a large majority of transactions being non-fraudulent.
The value 1 is for fraudulent transactions, value 0 is for nonfraudulent transactions
Methods and Algorithms
SMOTE create elements specifically for the minority class. The algorithm picks examples from the feature space that are close to one another, draws a line connecting the examples, and then creates a new sample at a position along the line.
Using these two techniques, we were able to balance the training data by transforming the original dataset which had 200405 genuine transactions and 354 fraudulent transactions into a balanced dataset with 198276 examples of each class.
This is an important step in training a model for a classification task, as it helps to prevent the model from having a bias towards one class.
Machine Learning Models
Evaluating the results
Random Forest Test Results |
XGBoost Test Results |
Conclusion
In this project, we successfully developed a credit card fraud detection model using machine learning techniques. By implementing oversampling and undersampling techniques, we were able to improve the performance of our models and achieve good results. The Random Forest model was found to be the best performing model in terms of precision and F1 score, while the XGBoost classifier had a better recall score.
Project resources:
GitHub project link: https://github.com/BoulahiaAhmed/Credit-Card-Fraud-Detection
0 comments:
Post a Comment