Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

💳 Credit Card Fraud Detection using Logistic Regression

This project demonstrates how Machine Learning can be used to detect fraudulent credit card transactions.
A Logistic Regression model is trained to classify transactions as fraudulent or legitimate.


📌 Project Description

Credit card fraud is a major issue in the financial sector.
The objective of this project is to build a binary classification model that can identify suspicious transactions and help reduce fraud-related losses.

The project focuses on:

  • Data preprocessing
  • Feature scaling
  • Logistic Regression model training
  • Model evaluation using accuracy

📥 Dataset

The dataset used in this project is taken from Kaggle:

🔗 https://www.kaggle.com/datasets/mlg-ulb/creditcardfraud


🛠️ Technologies Used

  • Python 🐍
  • NumPy
  • Pandas
  • Scikit-learn
  • Jupyter Notebook

🤖 Machine Learning Algorithm

Logistic Regression

Logistic Regression is a supervised learning algorithm used for binary classification problems.

Target Classes:

  • 0 → Legitimate Transaction
  • 1 → Fraudulent Transaction

🔄 Project Workflow

  1. Import required libraries
  2. Load the dataset
  3. Preprocess the data
  4. Split data into training and testing sets
  5. Apply feature scaling using StandardScaler
  6. Train the Logistic Regression model
  7. Evaluate model performance using accuracy score

📊 Model Evaluation

The model is evaluated using:

  • Accuracy Score 0.949238578680203

This metric helps measure how well the model correctly classifies transactions.


▶️ How to Run the Project

  1. Clone the repository:

    git clone https://github.com/Vinay-Rai/credit-card-fraud-detection.git
  2. Navigate to the project directory:

    cd credit-card-fraud-detection
  3. Install required dependencies:

    pip install -r requirements.txt
  4. Download the dataset from Kaggle and place it inside a data/ folder:

    data/creditcard.csv
    
  5. Open the Jupyter Notebook:

    jupyter notebook Credit_Card_Fraud_Detection.ipynb

📌 Future Enhancements

  • Use advanced models like Random Forest or XGBoost
  • Handle class imbalance using SMOTE
  • Add Precision, Recall, F1-score, and ROC-AUC metrics
  • Deploy the model using Flask or Streamlit

🎯 Conclusion

This project shows how Logistic Regression can be effectively applied to a real-world fraud detection problem.
It is beginner-friendly and serves as a strong foundation for more advanced machine learning projects.


⭐ If you find this project helpful, feel free to star the repository!

About

Machine learning project to detect credit card fraud using Logistic Regression with data preprocessing, feature scaling, and model evaluation.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages