Skip to content

Repository files navigation

Credit Card Fraud Detection System

This is a Python-based machine learning project that detects fraudulent credit card transactions.

1. Prerequisites

Before starting, ensure you have Python 3 installed on your computer.

2. Setup Instructions (For a New Computer)

If you are copying this project to a new computer (or presenting it), follow these exact steps to set it up from scratch:

Step 1: Open the Terminal

Open a terminal (or Command Prompt) and navigate to the root directory of this project.

Step 2: Install Required Libraries

Install all the necessary libraries by running:

pip install -r requirements.txt

(If you are on a modern Linux system like Ubuntu and get an "externally-managed-environment" error, run pip install --break-system-packages -r requirements.txt instead).


3. Running the Project

Step 1: Add the Dataset

  1. Go to Kaggle: Credit Card Fraud Detection Dataset.
  2. Download and extract the ZIP file.
  3. Move the extracted creditcard.csv file into the data/ folder inside this project directory (data/creditcard.csv).

Step 2: Train the Model

Before you can make predictions, you must train the machine learning model.

python3 src/train_model.py

This script will:

  • Load and balance the highly imbalanced dataset.
  • Train the Logistic Regression algorithm.
  • Save the model's "brain", scaler, and baseline features into the models/ directory.
  • Generate a visual Confusion Matrix plot in the notebooks/plots/ folder.

Step 3: Run the Interactive Showcase

Once the model is trained and saved, you can launch the live interactive terminal to showcase the project:

python3 src/predict.py

This will launch a highly-styled CLI application where you can type in a transaction amount and time. The system will process it and instantly alert you if it is Legitimate or Fraudulent!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages