A machine learning project that detects fraudulent mobile money transactions using Random Forest.
# M-Pesa Fraud Detection Using Machine Learning (Random Forest)
## Overview
This project builds a Machine Learning fraud detection system for M-Pesa transactions using the Random Forest algorithm. The objective is to identify fraudulent transactions based on transaction characteristics, account behavior, and user activity patterns.
The project covers the complete machine learning workflow including data exploration, data cleaning, fraud analysis, feature engineering, model building, evaluation, and fraud prediction.
## Business Problem
A mobile money company operating across East Africa has experienced an increase in suspicious transactions. The company wants to automatically detect potentially fraudulent transactions and understand the factors that contribute most to fraud.
### Key Business Questions
* Which transactions are likely fraudulent?
* Does changing devices increase fraud risk?
* Are large transactions riskier?
* Are weekend transactions riskier?
* Does account age matter?
* Does logging in from a new location increase fraud risk?
## Dataset Information
The dataset contains 5,000 M-Pesa transactions and 13 features.
### Features
| Feature | Description |
| ----------------------- | ------------------------------------------ |
| TransactionID | Unique transaction identifier |
| Amount | Transaction amount (KES) |
| SenderCounty | Sender's county |
| ReceiverCounty | Receiver's county |
| TimeOfDay | Hour transaction occurred |
| TransactionType | Transaction category |
| AccountAgeMonths | Age of account in months |
| TransactionsLast24Hours | Number of transactions in last 24 hours |
| DeviceChangedRecently | Whether user recently changed device |
| NewLocationLogin …