Phase 3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

MOUNT ZION COLLEGE OF ENGINEERING AND TECHNOLOGY

FRAUD DETECTION IN FINANCIAL


TRANSACTION

PRESENTED BY
PL.LAKSHMANAN

II Yr BE.CSE

Roll NO:911722104064
INTRODUCTION:
Phase 3 of our fraud detection in online transactions project pivots towards data
visualization, a pivotal facet of data analysis and interpretation. Proficient data visualization
techniques are instrumental in conveying insights, trends, and patterns within the vast
datasets inherent to online transaction monitoring. By leveraging visual representations,
stakeholders gain a clearer understanding of intricate relationships, empowering them to
make informed decisions critical for the advancement and security of online financial
operations.

OBJECTIVES:

Create informative and visually appealing visualizations to explore and communicate key
insights from the dataset.
Utilize various visualization techniques to effectively represent different types of data.
Enhance user engagement and understanding through interactive visualizations.

Document the data visualization process comprehensively for transparency and


reproducibility.
DATA DESCRIPTION:
The dataset consists of transaction data captured from an online platform, representing
various attributes related to user interactions and financial activities. Key data points include
transaction amount, timestamp, user ID, location, payment method, and transaction status
(e.g., approved or declined). Each row in the dataset details individual transaction
characteristics, providing a comprehensive view of user behavior and transaction patterns.
This dataset enables the analysis of potential fraudulent activities and the identification of
trends and anomalies in online transactions.
DATA VISUALIZATION TECHNIQUES:
1. UNIVARIATE VISUALIZATIONS:

- Histograms: Displaying the distribution of numerical variables.

- Bar Charts: Visualizing the frequency distribution of categorical variables

CODE:

import matplotlib.pyplot as plt


import pandas as pd
data=pd.read_csv("fraudtest.csv")
plt.hist(data['cc_num'], bins=20)
plt.xlabel('Value')
plt.ylabel('Frequency')
plt.title('Histogram of cc_num')
plt.show()
OUTPUT:

CODE:
plt.bar(data['category'].value_counts().index,
data['category'].value_counts().values)
plt.xlabel('Category')
plt.ylabel('Frequency')
plt.title('Bar Chart of Category Column')
plt.show()
OUTPUT:

2. BIVARIATE VISUALIZATIONS:

CODE:
plt.scatter(data['gender'], data['cc_num'])
plt.xlabel('gender')
plt.ylabel('cc_num')
plt.title('Scatter Plot of Gender vs cc_num')
plt.show()
OUTPUT:
CODE:
import seaborn as sns
sns.boxplot(x='category', y='cc_num', data=data)
plt.xlabel('Category')
plt.ylabel('cc_num')
plt.title('Box Plot of cc_num by Category')
plt.show()
OUTPUT:

3. MULTIVARIATE VISUALIZATIONS
CODE:
sns.pairplot(data)
plt.title('Pair Plot of Numerical Variables')
plt.show()
OUTPUT:

4. INTERACTIVE VISUALIZATIONS:

CODE:
import plotly.express as px
fig = px.scatter(data, x='street', y='city', hover_data=['cc_num'])
fig.show()
OUTPUT:
CODE:
import pandas as pd
import dash
from dash import dcc
from dash import html
import plotly.express as px

columns = ['trans_date_trans_time', 'cc_num', 'merchant', 'category', 'amt', 'first',


'last', 'gender', 'street', 'city', 'state', 'zip', 'lat', 'long', 'city_pop', 'job', 'dob',
'trans_num', 'unix_time', 'merch_lat', 'merch_long', 'is_fraud']

data = pd.read_csv("fraudtest.csv", usecols=columns)

data['trans_date_trans_time'] = pd.to_datetime(data['trans_date_trans_time'])

app = dash.Dash(__name__)

fig = px.scatter(data, x='trans_date_trans_time', y='amt', color='is_fraud',


title='Interactive Scatter Plot of Transaction Amounts Over Time',
labels={'trans_date_trans_time': 'Transaction Date and Time', 'amt':
'Transaction Amount'},
hover_data=['cc_num', 'merchant', 'category', 'city', 'state', 'zip', 'is_fraud'])

app.layout = html.Div([
dcc.Graph(
id='interactive-plot',
figure=fig
)
])

if __name__ == '__main__':
app.run_server(debug=True)
OUTPUT:

ASSUMED SCENARIO:

Scenario: The project aims to provide stakeholders with interactive visualizations


to explore transaction data and gain insights into fraudulent behavior and
patterns.
Objective: Enhance decision-making and understanding through intuitive visual
representations of data.
Target Audience: Project stakeholders, including data analysts, fraud prevention
specialists, and executives seeking actionable insights from the dataset.

CONCLUSION:

Phase 3 focuses on data visualization techniques to uncover insights and patterns


within the fraud detection dataset. By leveraging various visualization methods
and assuming a scenario aimed at providing stakeholders with interactive
visualizations, we aim to facilitate better decision-making and understanding of
fraudulent behaviors and transaction patterns.

THANK YOU

You might also like