Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are required to extract data from relevant dataset(s), namely the transaction.txt, frauddescription.txt, and descriptions.txt. Three datasets are provided. The first dataset(description.txt) contains the description

You are required to extract data from relevant dataset(s), namely the transaction.txt, frauddescription.txt, and descriptions.txt.

Three datasets are provided. The first dataset(description.txt) contains the description of genuine transactions. The second dataset(fraudulent-transaction.txt) contains the description of fraudulent transactions. The last dataset(transaction.txt) contains the actual transactions (10,000). The transaction dataset contains the description of the transactions, the amount of the transactions and the locations of the transactions. The locations are not real location to avoid tracing any transaction to anyone. The locations are just Euclidean coordinates in x, and y points. The following are the attributes of the transaction dataset, also see Figure 1.

Figure 1: sample data from the transaction.txt

image text in transcribed

* The user id

* The transaction id

* The description of the transaction

* The amount of the transaction

* The x coordinate of each transaction

* The y coordinate of each transaction

* A Boolean label that represents whether the transaction is fraudulent or not.

Q1. Implement a statistics_module. This module will contain the following functions: (NB:Only python file objects can be used for this task)

* A function that returns the average transactions of any user and of all users.

* A function that returns the mode of transactions of any user and that of all users.

* A function that returns the median of all transactions of a user and that of all users.

* A function that returns the interquartile range of any users transactions and of all users.

* A function that returns the location centroid of any user based on their transaction locations.

* A function that computes the standard deviation of any specific users transaction.

* A function that determines whether a transaction is fraudulent or not. It should provide details of such transactions.

* A function that returns an abnormal transaction for any given user.

* A function that computes the Z -score of any users transactions and for all users transactions.

* A function that computes those frequencies of transactions at any given location.

* A function that returns outlier of any location and of any user.

* A function that returns nth percentiles of transactions of any user and of all users.

Q2. Implement the main module(test_module) containing the function that implements the user interface through which users can query and interact with all statistical functions implemented. An informative menu-driven user interface should be implemented allowing friendly user interaction with your deliverable.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is electric dipole explain with example

Answered: 1 week ago

Question

What is polarization? Describe it with examples.

Answered: 1 week ago