Skip to content
Project: Detecting Anomalous Transactions
Fraud doesn’t just cost money—it costs trust. As a key member of a financial compliance team, your mission is to uncover suspicious transactions that might otherwise slip through the cracks. With the stakes this high, your insights could be the difference between stopping fraud in its tracks or letting it go unnoticed.
In this project, you'll harness the power of IForest from pyod.models to detect anomalies in banking data. Your challenge: flag unusual transactions, summarize your findings, and deliver actionable insights that ensure trust, security, and efficiency in financial operations.
Hints and Notes
- Ensure there are no missing values in the output DataFrame.
- Be sure to label the axes and legend clearly on the histogram to make the anomalies easily identifiable.
The Data
You will work with a dataset containing information about financial transactions. Below is a summary of the key columns provided:
Column | Description |
---|---|
TransactionID | A unique identifier for each transaction. |
TransactionAmount | The amount of money involved in the transaction (in USD). |
TransactionDuration | Duration of the transaction (in seconds). |
AccountBalance | The balance of the account after the transaction was processed (in USD). |
# Re-run this cell
# Import required libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# Load the dataset
transactions = pd.read_csv("transactions.csv")
# Isolate key columns
columns_to_display = ["TransactionID", "TransactionAmount", "TransactionDuration", "AccountBalance"]
transactions = transactions[columns_to_display]
# Display the first rows of the table
transactions.head()
# Start coding here
# Use as many cells as you need