Skip to content

Bill2926/BankFraudML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bankfraudML — Transaction Intelligence Platform

A high-performance fraud detection system leveraging Random Forest and K-Medoids Clustering to analyze transaction patterns. Built with FastAPI and a Cyberpunk-inspired terminal UI.

📂 Project Structure

bankfraudML/
├── .venv/               # Virtual environment
├── app/
│   ├── models/          # Trained .pkl model files
│   ├── main.py          # FastAPI application & routes
│   └── modelProcess.py  # ML logic & Feature engineering
├── static/
│   └── css/             # im lazy so I didn't use it
├── templates/
│   └── index.html       # Terminal UI
├── bank_data.db         # SQLite database
├── dataPre.py           # Data initialization script
└── requirements.txt     # Project dependencies

🛠 Prerequisites

  • Python: 3.11.x (Strictly preferred)
  • OS: Windows (Command usage optimized for PowerShell)

🚀 Setup & Execution

1. Environment Activation

Activate the virtual environment to ensure all dependencies are isolated.

# In Windows PowerShell
& ./.venv/Scripts/Activate.ps1

2. Dependency Installation

Install the necessary ML and Web frameworks:

pip install -r requirements.txt

3. Data Preprocessing

You must run the preprocessing script first to initialize the SQLite database and prepare the lookup tables for the models.

python dataPre.py

4. Launch the API

Start the FastAPI server. The entry point is located in the app directory.

uvicorn app.main:app --reload

🧪 API Usage

Once the server is live at http://127.0.0.1:8000:

  1. Terminal UI: Access the interactive dashboard via your browser.
  2. REST Endpoint: Send POST requests to /predict with the following JSON shape:
{
  "step": 179,
  "customer": "C1234567",
  "age": 3,
  "gender": "M",
  "merchant": "M1823072687",
  "category": "food",
  "amount": 150.00
}

🧑🏿‍💻 Other notes:

This is just my own archived version of my works in the unit COS30049 - Innovation Tech Project at Swinburne Vietnam. This is one of the earliest ML product in my IT career. Hope I can get far in this journey:)

About

This is a Machine Learning project in my COS30049 - Computing Technology Innovation Project at Swinburne Hanoi.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages