This project implements a machine learning model to detect fraudulent transactions in online payments. The system analyzes various transaction features to classify whether a payment is fraudulent or legitimate.
The project uses the PaySim synthetic dataset, which simulates mobile money transactions based on a sample of real transactions extracted from one month of financial logs from a mobile money service implemented in an African country. The dataset can be found on Kaggle:
PaySim Mobile Money Transactions Dataset
type: Type of transaction (CASH_OUT, PAYMENT, CASH_IN, TRANSFER, DEBIT)amount: The amount of the transactionoldbalanceOrg: Original balance before the transactionnewbalanceOrig: New balance after the transactionisFraud: Target variable indicating whether the transaction is fraudulent (1) or not (0)
The project is implemented in Python using Jupyter Notebook and includes:
- Data preprocessing and exploration
- Feature engineering
- Transformation of categorical features
- Label encoding for transaction types
- Model training and evaluation
- Dataset splitting into training and test sets
- Classification model implementation
- Python 3.x
- Jupyter Notebook
- Required libraries:
- numpy
- pandas
- scikit-learn
- Clone this repository
- Download the dataset from Kaggle (link provided above)
- Open
payment_detection.ipynbin Jupyter Notebook - Run the cells sequentially to:
- Load and preprocess the data
- Train the model
- Evaluate the results
├── README.md
├── payment_detection.ipynb # Main Jupyter notebook containing the analysis
└── requirements.txt # Python dependencies
This project is open source and available under the MIT License.
- Dataset provided by PaySim on Kaggle
- Inspired by real-world financial transaction systems