Fraud Transaction Analysis
Fraud Transaction Analysis
A project
Submitted to the Department of Computer Science and Engineering
Bangladesh University of Business and Technology (BUBT), Dhaka
In partial fulfillment of requirements
For the Capstone project (CSE-498)
Of
BACHELOR OF SCIENCE
IN
COMPUTER SCIENCE AND ENGINEERING.
SUBMITTED BY-
Name ID Intake
SUPERVISED BY-
Mijanur Rahaman
Assistant Professor
We hereby declare that the project entitled “ Money laundering and fraud transactions analysis
of mobile banking in Bangladesh using machine learning” submitted for the Capstone Project (CSE-
498) project works in Computer Science and Engineering in the faculty of Computer Science and
Engineering of Bangladesh University of Business and Technology (BUBT), is our original work
and that it contains no material which has been accepted for the award to the candidates of any other
degree or diploma, except where due reference is made in the next of the project to the best of our
knowledge, it contains no materials previously published or written by any other person except
where due reference is made in this project.
ii
APPROVAL
This project “ Money laundering and fraud transactions analysis of mobile banking in
Bangladesh using machine learning” report submitted by Shakil Ahmed Raju, Md Bakul and
Md.Nazibul Hasan students of Department of Computer Science and Engineering, Bangladesh
University of Business and Technology (BUBT), underthe supervision of Mr. Md. Mijanur
Rahman, Assistant Professor, Department of Computer Science and Engineering has been
accepted as satisfactory for the partial requirements for the degree of Bachelor of Science
Engineering in Computer Science and Engineering.
___________________
Mijanur Rahaman
____________________
Md. Saifur Rahman
Chairman
iii
ACKNOWLEDGEMENTS
“Task successful” makes everyone happy. But the happiness will be gold without glitter if we
didn’t state the persons who have supported us to make it a success. Success will be crowned
to people who made it a reality but the people whose constant guidance and encouragement
made it possible will be crowned first on the eve of success.
We express our gratitude to the help of our supervisor Mijanur Rahaman, for his constant
supervision, guidance and co-operation throughout the project and for giving constant
motivation and valuable help through the project work. We also would like to thanks to our
honorable chairman Md. Saifur Rahman, for his support and giving us support and giving us
permission to use the computer lab whenever we needed.
iv
ABSTRACT
Mobile banking is a system that allows customers of a financial institution to conduct a number
of financial transactions through a mobile device such as a mobile phone. It is quick and free,
and it usually allows you to perform a variety of activities, such as paying bills, mobile topup
and exchanging currency, without having to visit or call your branch. As a developing nation,
Bangladesh is seeing an increase in online banking. People are still reliant on online banking
because it makes a man's life much easier. Mobile banking services such as Rocket, bKash,
and Nagad are now available in the region. While mobile banking makes life easier, money
laundering incidents do occur from time to time. This thesis researches the detection of money
laundering and fraud transactions using machine learning techniques. These techniques have
potential benefits over time consuming human investigations to detect money laundering
transactions. Seven traditional machine learning classification algorithms Logistic Regression,
Random Forest, Naïve Bayes, support vector machine, Neural network, Decision tree, K
nearest neighbor algorithms to complete this research work and find the concluded delimiter
v
COPYRIGHT
© Copyright by Shakil Ahmed Raju (15162103136), Md Bakul mia (15163103063) and Md.
Nazibul Hasan Khan (14151103025).
vi
List of Tables
Page 7 of 44
List of Figures
Page 8 of 44
Figure 38: [Code output] Random Forest model training performance 35
Figure 39: Random Forest - Train Confusion Matrix 36
Figure 40: Random Forest - Test Confusion Matrix 37
Figure 41: [Code snippet] undersampling the training dataset 38
Figure 42: [Code output] Rows in the undersampled training data 38
Figure 43: [Code output] Logistic Regression Parameter Tuning - 39
Undersampling
Figure 44: [Code output] Parameters of the best fit Random Forest Model 40
Figure 45: Random Forest Model Feature Importance 41
Figure 46: ROC curve of Random Forest Model 41
Figure 47: Result Summary 42
Page 9 of 44
Table of Contents
Acknowledgments .............................................................................................................. iv
Abstract ................................................................................................................................v
List of Figures ..................................................................................................................... vi
List of Tables ...................................................................................................................... vii
Chapter 1 ........................................................................................................................... 12
1.1 Introduction ................................................................................................................ 12
1.2 Aims and Objectives .................................................................................................. 12
1.3 Research Methodology .............................................................................................. 13
1.4 Limitations of the Study ............................................................................................. 14
Chapter 2 ........................................................................................................................... 15
2.1 Literature Review ........................................................................................................ 15
Chapter 3 ........................................................................................................................... 15
3.1 Methodology............................................................................................................... 17
3.2 Tools Used.................................................................................................................. 17
3.3 Data Sources ............................................................................................................... 18
Chapter 4 ........................................................................................................................... 19
4.1 Data Analysis ............................................................................................................. 19
4.2 Detailed Analysis ....................................................................................................... 19
4.2.1 Data Cleaning....................................................................................................... 19
4.2.1.1 Data Description ............................................................................................ 20
4.2.1.2 Type Conversion ........................................................................................... 20
4.2.1.3 Summary Statistics ....................................................................................... 21
4.2.1.4 Missing Values Check ................................................................................... 22
4.2.2 Exploratory Analysis ........................................................................................... 22
4.2.2.1 Class Imbalance ............................................................................................ 22
4.2.2.2 Types of Transactions .................................................................................. 24
4.2.2.3 Data Sanity Checks ....................................................................................... 26
4.2.2.3.1 Negative or Zero Transaction Amounts ................................................ 26
4.2.2.3.2 Originator’s balance and recipient’s balance ....................................... 27
4.2.2.3.3 Fraud Transactions Analysis ................................................................. 27
4.2.3 Predictive Modeling for Fraud Detection ........................................................... 32
4.2.3.1 Modeling Dataset Creation ........................................................................... 32
Page 10 of 44
4.2.3.1.1 Creating dummy variables ..................................................................... 33
4.2.3.1.2 Standardizing the data ........................................................................... 33
4.2.3.1.3 Create train and test datasets ................................................................ 33
4.2.3.2 Classification Models for Fraud detection .................................................. 34
4.2.3.2.1 Logistic Regression Model .................................................................... 35
4.2.3.2.2 Random Forest Model ............................................................................ 36
4.2.3.2.3 Addressing Class Imbalance ................................................................. 38
4.2.3.2.4 Best Fit Model Details............................................................................. 40
4.2.4 Analysis Summary................................................................................................ 41
4.2.5 Result Summary ................................................................................................... 39
Chapter 5 ........................................................................................................................... 40
5.1 Conclusion ................................................................................................................. 41
5.2 Recommendations ..................................................................................................... 42
References ...................................................................................................................... 443
Page 11 of 44
Chapter 1
1.1 Introduction
Digital payments of various forms are rapidly increasing across the world. Payments
companies are experiencing rapid growth in their transactions volume. Along with this
transformation, there is also a rapid increase in financial fraud that happens in these
payment systems.
Preventing online financial fraud is a vital part of the work done by cybersecurity and
cyber-crime teams. Most banks and financial institutions have dedicated teams of
dozens of analysts building automated systems to analyze transactions taking place
through their products and flag potentially fraudulent ones. Therefore, it is essential to
explore the approach to solving the problem of detecting fraudulent entries/transactions
in large amounts of data in order to be better prepared to solve cyber-crime cases.
This project was a few month's efforts to develop a framework of fraud detection in
financial transactions. We hope the outcome of the project will help streamline the
analysis and detection of fraudulent transactions.
• To study the literature on financial fraud detection and understand the different
aspects of the problem.
• To solve the problem of financial fraud detection on a publicly available sample
dataset using machine learning techniques.
• To compare different classification techniques to understand which is best
suitable for this application.
Ultimately, the creation of a framework and codes that incorporate analytics and
machine learning concepts studied in the program is the goal. The success of the project
is predicated on the accuracy of the classification results and the extent of analysis
conducted. We hope the final report will serve as a benchmark for further development
on this topic and as a knowledge base for students to understand the nuances of fraud
detection.
Page 12 of 44
1.3 Research Methodology
The typical machine learning approach was followed in this project. The identified
dataset has labelled class variable, which was used as the prediction variable in machine
learning models.
• Through exploratory analysis, we analyzed the data set in detail and identified
possible predictors of fraud.
• Through various visualization techniques, we observed the separation between
fraud and non-fraud transactions.
• To solve the fraud detection problem, we experimented with two supervised
machine learning techniques – Logistic Regression and Random Forest.
• Additionally, we also tried under-sampling to address the class imbalance in the
dataset.
• The models were developed with cross-validation to avoid overfitting and obtain
consist of performance.
• Performance measures, like Confusion Matrix and Area Under Curve (AUC),
was used to compare the performance of the models.
This analysis was conducted using Python through Jupyter notebook. In-built libraries
and methods were used to run the machine learning models. When needed, functions
were defined to simplify specific analyses or visualizations. The below diagram shows
in detail the full process that was followed in the project.
Page 13 of 44
1.4 Limitations of the Study
Page 14 of 44
Chapter 2
Albashrawi et al., (2016) present a systematic review of the most used methods in
financial fraud detection. The top 5 techniques are shown in the table below:
• Phua et al., (2004) used Neural Networks, Naïve Bayes and Decision Trees to
detect automobile insurance fraud.
• Ravisankar et al., (2011) detect financial statement fraud in Chinese companies,
another article used SVM, Genetic Programming, Logistic Regression and
Neural Networks.
• Density-based clustering (Dharwa et al., 2011) and cost-sensitive Decision Trees
(Sahin et al., 2013) have been used for credit card fraud.
Page 15 of 44
• Sorournejad et al., (2016) discusses both supervised and unsupervised machine
learning-based approaches involving ANN (Artificial Neural Networks), SVM,
HMM (Hidden Markov Models), clustering.
• Wedge et al., (2018) address the problem of imbalanced data that result in a very
high number of false positives, and some papers propose techniques to alleviate
this problem.
Page 16 of 44
Chapter 3
3.1 Methodology
This methodology served as the deliverables of the project. It describes the results of
each phase that was tried out and do a comparison between them to identify which is the
best technique to address the fraud detection problem.
Each phase of the project has an output that describes the findings in that phase. These
deliverables were used in this final project are explained below –
This project was entirely done using Python, and the analysis was documented in a
Google colab notebook. Standard python libraries were used to conduct different
analyses.
These libraries are described below –
Page 17 of 44
• seaborn – used to generate charts and visualizations
• pandas – used for reading and transforming the data
Due to the private nature of financial data, there is a lack of publicly available datasets
that can be used for analysis. In this project, a synthetic dataset, publicly available on
Kaggle, generated using a simulator called PaySim is used. The dataset was generated
using aggregated metrics from the private dataset of a multinational mobile financial
services company, and then malicious entries were injected. (TESTIMON @ NTNU,
Kaggle).
The dataset contains 11 columns of information for ~6 million rows of data. The key
columns available are –
• Type of transactions
• Amount transacted
• Customer ID and Recipient ID
• Old and New balance of Customer and Recipient
• Time step of the transaction
• Whether the transaction was fraudulent or not
In the following figure, a snapshot of the first few lines of the data set is presented.
Page 18 of 44
Chapter 4
This section describes each step of the analysis conducted in detail. All analysis is
documented in Jupyter notebook format, and the code is presented along with the
outputs.
The analysis is split into three main sections. These are described in the diagram below.
The following pages show the step by step process followed in executing the mentioned
analysis structure. Relevant code snippets and graphics included are based on Python
programming language.
This section describes the data exploration conducted to understand the data and the
differences between fraudulent and non-fraudulent transactions.
Page 19 of 44
4.2.1.1 Data Description
The data used for this analysis is a synthetically generated digital transactions dataset
using a simulator called PaySim. PaySim simulates mobile money transactions based
on a sample of real transactions extracted from one month of financial logs from a
mobile money service implemented in an African country. It aggregates anonymized
data from the private dataset to generate a synthetic dataset and then injects fraudulent
transactions.
The dataset has over 6 million transactions and 11 variables. There is a variable named
‘isFraud’ that indicates actual fraud status of the transaction. This is the class variable
for our analysis.
The columns in the dataset are described as follows:
Since it is necessary that all columns in the data are of appropriate type for analysis, we
check if there is any need for type conversion. Here are the initial types of the columns
read by python.
Page 20 of 44
Out[10]: step int64 object
type amount float64 object
nameOrig float64 float64
oldbalanceOrg object float64
newbalanceOrig float64 int64
nameDest int64
oldbalanceDest
newbalanceDest
isFraud
isFlaggedFraud
dtype: object
Before proceeding with the analysis, we present the summary statistics of the variables.
In case of numeric variables, we evaluate the mean, standard deviation and the range of
values at different percentiles. In case of categorical variables, we evaluate only the
number of unique categories, the most frequent category and its frequency.
Page 21 of 44
type nameOrig nameDest isFraud isFlaggedFraud
6354407 6362604
In this phase, we also check if there are any missing values in the dataset. The following
code and output indicate the total number of missing / NA values in all columns, which
is zero.
In this exploratory analysis, we assess the class imbalance in the dataset. The class
imbalance is defined as a percentage of the total number of transactions presented in the
isFraud column.
The percentage frequency output for the isFraud class variable is shown below:
Page 22 of 44
Fraud Flag Percentage_Transactions
0 Non-Fraud 99.87
1 Fraud 0.13
As we can see from the figure.10 there is an enormous difference between the
percentage_transactions.
Only 0.13% (8,213) transactions in the dataset are fraudulent indicating high-class
imbalance in the dataset. This is important because if we build a machine learning model
on this highly skewed data, the non-fraudulent transactions will influence the training
of the model almost entirely, thus affecting the results.
Page 23 of 44
4.2.2.2 Types of Transactions
In this section, we are exploring the dataset by examining the 'type' variable. We present
what the different 'types' of transactions are and which of these types can be fraudulent.
The following plot shows the frequencies of the different transaction types:
Page 24 of 44
Only CASH-OUT and TRANSFER transactions can be fraudulent. So, it makes sense
to retain only these two types of transactions in our dataset.
From figure.13 the fraudulent transactions are splitted in an equal percentage.
Therefore, we managed to reduce the data from over 6 million transactions to ~2.8
million transactions.
Page 25 of 44
4.2.2.3 Data Sanity Checks
First, we check if the amount column is always positive. The following two code
snippets break this into the number of transactions where the amount is negative and
those where the amount is 0.
There are only a few cases in which transacted amount is 0. We observe by exploring
the data of these transactions that they are all fraudulent transactions. So, we can assume
that if the transaction amount is 0, the transaction is fraudulent.
We remove these transactions from the data and include this condition while making
the final predictions.
Page 26 of 44
4.2.2.3.2 Originator’s balance and recipient’s balance
In this section, we check if there are any ambiguities in the originator’s balance or
recipient’s balance. The following output identifies instances where originator’s initial
balance or recipient’s final balance is 0.
Therefore, in almost half of the transactions, the originator's initial balance was recorded
as 0. However, in less than 1% of cases, the recipient's final balance was recorded as 0.
Ideally, the recipient's final balance should be equal to the recipient's initial balance plus
the transaction amount. Similarly, the originator's final balance should be equal to
originator's initial balance minus the transaction amount.
Then, we check these conditions to see whether the old balance and new balance
variables are captured accurately for both originator and recipient.
Therefore, in most transactions, the originator's final balance is not accurately captured,
and in almost half the cases, the recipient's final balance is not accurately captured.
It could be interesting to see if any of the above discrepancies identified vary between
fraudulent transactions and non-fraudulent transactions. This will be done in subsequent
sections.
Page 27 of 44
steps where fraudulent transactions are more common than others. From the data
description, we know that each time step is an hour.
From Figure.19 show that the fraud transactions are almost uniformly spread out across
time steps, whereas non-fraudulent transactions are more concentrated in specific time
steps. This could be a differentiator between the two categories and can help in the
training of the classification models.
Transaction Amount:
We now check if there are any differences between fraud and non-fraud transactions in
terms of the transaction amount.
Page 28 of 44
Figure 20: Transaction Amount of Fraud and Non-Fraud Transactions
The distribution of the transaction amount suggests that the amount can be slightly
higher for Non-Fraud transactions, but nothing can be said conclusively about
differences Fraud and Non-Fraud in terms of the transaction amount.
Balances:
In the previous section on Sanity Checks, we noticed that there are inaccuracies in how
the ‘balance’ variable is captured for both originator and recipient. We also observed
that in almost half the cases, the originator’s initial balance is recorded as 0.
In the below code, we compare the percentage of cases where originator’s initial balance
is 0.
% of fraudulent transactions where initial balance of originator is 0: 0.31%
Figure 21: [Code Output] Comparison of fraud and non-fraud transactions where
originator's initial balance is 0
Page 29 of 44
In fraudulent transactions, originator’s initial balance is 0 only 0.3% of the time as
compared to 47% in case of non-fraudulent transactions. This could be another potential
differentiator between the two categories.
We check the inaccuracy in the balance variable and compare between fraud and
nonfraud. The inaccuracy is defined as the difference between what the balance should
be accounting for the transaction amount and what it is recorded as balance.
We calculate the balance inaccuracies for both the originator and destination as follows:
In the following figures, we depicted the distribution of the balance inaccuracy feature
of originator and destination balances for fraud and non-fraud transactions as below:
Page 30 of 44
Figure 24: Destination Balance Inaccuracies of Fraud and Non-Fraud
Transactions
There are differences between fraud and non-fraud in the inaccuracy measures we
analyzed above. In particular, it appears that the inaccuracy in destination balance is
almost always negative for non-fraud transactions, whereas it is almost always positive
for fraud transactions. This could also be potential predictors of fraud.
Overall, we identified a few dimensions along which fraudulent transactions can be
distinguished from non-fraudulent transactions. These are as follows:
• time step - fraudulent transactions have are equally likely to occur in all time
steps, but genuine transactions peak in specific time steps
The below scatter plot shows a clear differentiation between fraudulent and
nonfraudulent transactions along time step and destination balance inaccuracy
dimensions.
Page 31 of 44
Figure 25: Separation between Fraud and Non-Fraud Transactions
In this section, we choose the variables needed for the ML model, encode categorical
variables as numeric and standardize the data.
Let us recall columns in the dataset
Index(['step', 'type', 'amount', 'nameOrig', 'oldbalanceOrg', 'newbalanceOri g',
'nameDest', 'oldbalanceDest', 'newbalanceDest', 'isFraud', 'origBalance_inacc',
'destBalance_inacc'],dtype='object')
The name (or ID) of the originator and destination are not needed for classification. So,
we remove them.
Page 32 of 44
4.2.3.1.1 Creating dummy variables
We have one categorical variable in the dataset – the transaction type. This feature needs
to be encoded as binary variables, and dummy variables need to be created. The
following code snippet is used to perform this.
# Creating dummy variables through one hot encoding for 'type' column
In this transformation, we convert all columns in the data to have the same range. This
is done through the standard scaler feature available in python. The following code
snippet is used to perform this transformation.
# Normalization of the
dataset std_scaler =
StandardScaler()
data_scaled =
pd.DataFrame(std_scaler.fit_transform(data.loc[:,~data.columns.isin(['isFraud'])]))
data_scaled.columns = data.columns[:-1] data_scaled['isFraud'] = data['isFraud']
We split the scaled dataset into training and testing datasets. We decide to use 70% of
the original data for training and the remaining 30% for testing.
The following code snippet is used to create training and testing datasets.
Page 33 of 44
X = data_scaled.loc[:, data_scaled.columns != 'isFraud'] y
= data_scaled.loc[:, data_scaled.columns == 'isFraud']
label_encoder = LabelEncoder()
y_train_original = label_encoder.fit_transform(y_train_original.values.ravel()) y_test_original
= label_encoder.fit_transform(y_test_original.values.ravel())
Then we check whether the class imbalance in train and test datasets are similar. The
following code output indicates the % of transactions that are fraud in the two datasets
–
Figure 30: [Code output] Class imbalance in train and test datasets
We define six models to perform the classification: Naïve Bayes, Logistic Regression,
SVM, K Nearest Neighbors, Decision Tree and Random Forest.
Alternatively, we could also go with Area Under Curve (AUC) of the ROC curve.
However, this will not adequately capture if the model is correctly identifying most of
Page 34 of 44
the fraudulent transactions. Therefore, we use this as a validation of the model
performance.
The following code snippet is used to define the accuracy of the two models.
accuracy_dict = {}
model_lr = LogisticRegression()
model_rf = RandomForestClassifier()
scr = 'recall'
Figure 31: [Code snippet] Defining Logistic Regression and Random Forest Models
We also need to do cross-validation to ensure the models do not overfit the training data.
For this, we use Stratified 5-fold since we need to ensure that the class imbalance is
retained in the validation sets.
skf = StratifiedKFold(5)
In this section, we train the logistic regression model and calculate the mean recall score.
This parameter will serve as a benchmark for further experiments.
lg = LogisticRegression()
lg.fit(X_train_cs, y_train)
y_pred = lg.predict(X_valid_cs)
The following output indicates how the Logistic Regression model performs on the
training dataset.
Page 35 of 44
Figure 34: Logistic Regression model performance
Therefore, the default Logistic Regression model is able to capture only half of the actual
Fraud cases.
We plot the confusion matrixes for the train and test datasets of the logistic regression model,
and we check the precision and recall in each case.
In this section, we repeat the same steps using a different classification algorithm such as
Random Forest, and we calculate the mean recall score. We can compare with the Logistic
Regression model to evaluate which is to perform better.
The following output indicates how the Random Forest model performs on the training dataset.
Random Forest's average recall score across validation sets is: 99.48%
The Random Forest model seems to produce excellent results on the training dataset. Again,
we plot the confusion matrices for the training and testing datasets and we check the precision
and recall in each case.
Precision: 100.0%
Recall: 99.84%
Page 36 of 44
Figure 39: Random Forest - Train Confusion Matrix
Precision: 100.0%
Recall: 99.79%
The Random Forest algorithm gives almost perfect results. Comparing the recall scores with
Logistic Regression, Random Forest performs much better in detecting fraud.
Also, the performance of the Random Forest model is consistent between the training and
testing datasets. So, there is no overfitting.
The following table compares the results of the two models:
Page 37 of 44
Table 4: Comparison of Results of models
Regardless of the positive results from the Random Forest model, we should try to improve the
results of Logistic Regression through parameter tuning and by addressing the class imbalance.
In the following section, we present these techniques.
There are many techniques to address high-class imbalanced datasets. A few examples are
as follows –
• Undersampling: In this method, random samples from the majority class are
deleted so that the class imbalance is more manageable.
• Oversampling: In this method, observations of the minority class are resampled
with repetition to increase their presence in the data
• SMOTE: This is a type of oversampling, but instead of repeating the observations,
it synthesizes new plausible observations of the minority class
Page 38 of 44
undersample_non_fraud_indices_train =
np.random.choice(non_fraud_indices_train, len(fraud_indices_train), replace = False)
undersample_non_fraud_indices_train = np.array(undersample_non_fraud_indices_train)
undersample_indices_train = np.concatenate([fraud_indices_train,
undersample_no n_fraud_indices_train])
X_train_undersample =
X_train_original.loc[X_train_original.reset_index(drop=True).index.isin(undersample_i
ndices_train),:] y_train_undersample =
y_train_original[undersample_indices_train.tolist()]
Following code, the output indicates the number of transactions in the undersampled data
–
There are 11526 rows in the undersampled training data.
Page 39 of 44
Therefore, the best Logistic Regression model with undersampling (l1 penalty and C of
100) has a recall of <50%.
The default random forest model performs better than logistic regression model.
The Random Forest model gave the best results above. The parameters of this model are
presented in the following code.
The model uses 10 trees in the forest (n_estimators) and has an infinite max depth. Positive
crossvalidation results remove the possibility of overfitting.
In the following figure, we present the relative feature importance of the random forest
model. The following plot shows which variables are contributing more to make the fraud
prediction.
Page 40 of 44
Therefore, the balance of the originator (“newbalanceOrig”) feature is critical to making
the prediction as compared to all other variables.
For the Receiver-Operator Characteristics (ROC) curve and calculate Area-
UnderCurve (AUC) for this model is depicted in the following figure.
We analyzed the financial transactions data and developed a machine learning model to
detect fraud. The analysis included data cleaning, exploratory analysis and predictive
modeling.
In the data cleaning, we checked for missing values, converted data types and summarized
the variables in the data. In an exploratory analysis, we looked at the class imbalance, and
deep-dived into each of the variables, in particular transaction type, transaction amount,
balance and time step. We identified derived variables that can help with fraud detection.
We also plotted various graphs to better visualize the data and come up with insights.
In predictive modeling, we experimented with Logistic Regression and Random Forest
algorithms. We observed that Random Forest performs best for this application with almost
100% precision and recall scores. We tried to improve the logistic regression results by
undersampling, but the results were the same because of a lot of the data is excluded. We
ensured that there is no overfitting in the models through cross-validation.
We can conclude that fraud detection in financial transactions is successful in this labeled
dataset, and the best algorithm for this purpose is Random Forest.
Page 41 of 44
4.2.5 Result Summary
Page 42 of 44
Chapter 5
5.1 Conclusion
5.2 Recommendations
• Fraud detection in transactions data where transaction amount and balances of the
recipient and originator are available can be best performed using tree-based
algorithms like Random Forest
• Using dispersion and scatter plots to visualize the separation between fraud and
non-fraud transactions is essential to choose the right features
• To address the high-class imbalance typical in fraud detection problems, sampling
techniques like under sampling, oversampling, SMOTE can be used. However,
there are limitations in terms of computation requirements with these approaches,
especially when dealing with big data sets.
• To measure the performance of fraud detection systems, we need to be careful about
choosing the right measure. The recall parameter is a good measure as it captures
whether a good number of fraudulent transactions are correctly classified or not.
We should not rely only on accuracy as it can be misleading.
Page 43 of 44
References
Page 44 of 44