A machine learning project to detect fraudulent credit card transactions using Python and supervised learning techniques. This project focuses on building, training, and evaluating models to predict fraud effectively.
Credit card fraud is a major concern for financial institutions. This project aims to create a predictive model that can identify potentially fraudulent transactions from a dataset of credit card transactions. It includes preprocessing, exploratory data analysis, model training, and evaluation.
The dataset used in this project is the Credit Card Fraud Detection Dataset from Kaggle. It contains anonymized transaction data with features extracted via PCA, along with the Class label (1 for fraud, 0 for legitimate transactions).
Dataset Features:
Time: Seconds elapsed between each transaction and the first transaction in the dataset.V1–V28: PCA transformed features.Amount: Transaction amount.Class: Target label (0 = legitimate, 1 = fraud).
Clone this repository and install the required dependencies using pip or conda:
git clone https://github.com/ShubhamS2005/CreditCardFraudDetection.git
cd CreditCardFraudDetection
pip install -r requirements.txtconda create -n ccfraud python=3.11
conda activate ccfraud
pip install -r requirements.txt
Run the main notebook or script to train and evaluate models:
jupyter notebook CreditCardFraudDetection.ipynb
Preprocessing includes scaling the Amount and Time features and handling class imbalance.
Models used:
- Logistic Regression
- Random Forest
- XGBoost
The models are evaluated using Accuracy, Precision, Recall, F1-score, and ROC-AUC curve. Visualizations are included to analyze model performance and feature importance.
Contributions are welcome! If you want to improve the project:
- Fork the repository
- Create a new branch (git checkout -b feature-name)
- Make your changes
- Commit (git commit -m 'Add feature')
- Push (git push origin feature-name)
- Open a Pull Request
This project is open-source and available under the MIT License.
Made with ❤️ by Shubham Srivastava (shubhamsrivastava12568@gmail.com)
⭐ If you find this project useful, consider giving it a star on GitHub!