Skip to content

A machine learning web app to detect fraudulent financial transactions using Logistic Regression, Random Forest, and XGBoost.

Notifications You must be signed in to change notification settings

JayanthSrinivas06/Fraudulent-Transactions-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🕵️ Fraudulent Transactions Detection

This project is a machine learning-based solution to detect fraudulent financial transactions using models like Random Forest, Logistic Regression and XGBoost. It includes preprocessing, scaling, model training, and a basic web interface to test predictions on transaction data.


📂 Project Structure

Fraudulent-Transactions-Detection/
├── static/
│   └── style.css                         
├── Templates/
│   ├── index.html
│   ├── input.html
│   └── output.html                  
├── Train_data/                      
│   ├── fraudTrain.csv
│   └── fraudTest.csv
├── app.py                            
├── fraud.ipynb                           
├── model.pkl
├── scaler.pkl

🧠 Models Used

  • Logistic Regression
  • XGBoost Classifier
  • Random Forest

These models are trained on labeled transaction data to distinguish between legitimate and fraudulent transactions.


🗃️ Dataset

The dataset is stored in the Train_data/ folder:

  • fraudTrain.csv – training data
  • fraudTest.csv – testing/validation data

Each dataset includes transaction features such as amount, category, merchant info, and a label indicating fraud (1) or not (0).


⚙️ Tech Stack

  • Python
  • Pandas, NumPy
  • Scikit-learn
  • XGBoost
  • Flask (for web deployment)
  • HTML/CSS (used in Templates and static folders)

🚀 How to Run

  1. Clone the repository
git clone https://github.com/JayanthSrinivas06/Fraudulent-Transactions-Detection.git
cd Fraudulent-Transactions-Detection
  1. Install dependencies
pip install -r requirements.txt
  1. Run the Flask app
python app
  1. Visit the web interface

Open your browser and go to: http://localhost:5000


📈 Results

Both models are evaluated using metrics like:

  • Accuracy
  • Precision & Recall
  • Confusion Matrix

Random Forest generally provides better accuracy and recall for fraud detection tasks.


📬 Contact

Developed by Jayanth Srinivas Bommisetty
For questions or suggestions, feel free to reach out via LinkedIn


⭐ Star this repo if you found it useful!

About

A machine learning web app to detect fraudulent financial transactions using Logistic Regression, Random Forest, and XGBoost.

Topics

Resources

Stars

Watchers

Forks