Add anomaly detection project#18
Open
rashidrao-pk wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Credit Card Fraud Detection using Anomaly Detection
Issue
Fixes #18
Overview
This project demonstrates how anomaly detection techniques can be used to identify fraudulent credit card transactions. Since fraudulent transactions are extremely rare compared to legitimate transactions, anomaly detection provides an effective approach for detecting unusual patterns without relying heavily on balanced labeled data.
Dataset
The project uses the Credit Card Fraud Detection dataset, which contains transactions made by European cardholders in September 2013.
Dataset Features:
Dataset Source:
https://www.kaggle.com/datasets/mlg-ulb/creditcardfraud
Objectives
Models Implemented
1. Isolation Forest
Isolation Forest isolates anomalies by randomly selecting features and split values. Anomalies require fewer splits and are therefore easier to isolate.
2. Local Outlier Factor (LOF)
LOF identifies anomalies by comparing the local density of a sample with the density of its neighbors.
3. One-Class SVM
One-Class SVM learns the boundary of normal transactions and identifies samples outside this boundary as anomalies.
Evaluation Metrics
The following metrics are used for evaluation:
Project Structure
Workflow
Results
The notebook provides a side-by-side comparison of all implemented anomaly detection methods, highlighting their strengths and limitations when dealing with highly imbalanced fraud detection datasets.
Requirements
Running the Notebook
Learning Outcomes
After completing this project, users will understand:
Author
Muhammad Rashid
GitHub:
https://github.com/rashidrao-pk