File size: 1,505 Bytes
3806caf
00965f5
c627435
 
 
3806caf
 
 
00965f5
3806caf
00965f5
 
3806caf
 
c627435
3806caf
c627435
3806caf
c627435
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
title: FaudDetectionClassification
emoji: πŸ’³
colorFrom: indigo
colorTo: pink
sdk: docker
app_port: 8501
tags:
- streamlit
pinned: false
short_description: Fraud detection for online payments using a Random Forest
license: mit
---

# πŸ’³ Payment Fraud Detection

This project demonstrates how machine learning can be used to detect fraudulent online payment transactions.

The Streamlit app allows users to enter transaction details and receive a prediction:
- **0** β†’ Not Fraud  
- **1** β†’ Fraud  

---

## πŸš€ Application Overview

The app predicts fraud based on transaction-related features such as:
- Account age  
- Number of purchased items  
- Transaction time  
- Payment method and payment method age  

The goal is to accurately detect fraudulent transactions while minimizing false alarms.

---

## πŸ€– Model

- **Algorithm:** Random Forest Classifier  
- **Problem Type:** Binary Classification (Fraud vs. Not Fraud)  
- **Class Imbalance Handling:** SMOTE (Synthetic Minority Oversampling Technique)  
- **Evaluation Metrics:** Accuracy, Precision, Recall, F1-score, ROC-AUC  

Among all tested models, Random Forest achieved the best performance and was selected as the final model.

---

## πŸ“Š Model Performance (Summary)

- Excellent separation between fraud and non-fraud transactions  
- High precision and recall for fraud detection  
- Robust performance on imbalanced data  

---

## πŸ›  How to Run Locally

```bash
pip install -r requirements.txt
streamlit run app.py