Credit Card Fraud Detection This repository contains code for a credit card fraud detection project using machine learning techniques. The goal of this project is to detect fraudulent transactions from a dataset using supervised learning models.
Dataset The dataset (creditcard.csv) used in this project contains transactions made by credit cards in September 2013 by European cardholders. This dataset presents transactions that occurred in two days, where we have 492 frauds out of 284,807 transactions. The dataset is highly imbalanced, with the positive class (frauds) accounting for 0.172% of all transactions.
Data Exploration and Preprocessing Explored the dataset to understand its structure and distribution. Handled missing values and checked for duplicates. Visualized class distributions and transaction patterns using plots. Models Implemented Logistic Regression Implemented Logistic Regression to classify transactions as fraudulent or normal. Applied SMOTE (Synthetic Minority Over-sampling Technique) to handle class imbalance in the training data. Evaluated the model using accuracy scores, precision, recall, and F1-score. Visualized the results with a confusion matrix heatmap. Random Forest Classifier Implemented Random Forest Classifier with hyperparameter tuning (n_estimators, max_depth, min_samples_split, min_samples_leaf). Used SMOTE to balance the classes in the training set. Evaluated the model's performance and visualized results using accuracy metrics and a confusion matrix heatmap. Installation Clone the repository:https://github.com/Prernadivakar03
bash Copy code git clone https://github.com/Prernadivakar03/CODSOFT-CREDITCARD-FRAUDLENT-DETECTION/tree/main cd credit-card-fraud-detection Install the required Python packages:
bash Copy code pip install -r requirements.txt Run the Jupyter notebook or Python scripts to see the models in action.
Usage Run credit_card_fraud_detection.ipynb in Jupyter Notebook or Jupyter Lab. Follow the steps outlined to explore the dataset, preprocess the data, train the models, and evaluate their performance. Results
Acknowledgments The dataset used in this project is from Kaggle's Credit Card Fraud Detection dataset: https://www.kaggle.com/datasets/mlg-ulb/creditcardfraud Feel free to customize and expand this README with additional details about your implementation, any challenges faced, or future improvements planned. Happy coding!