Downloads · 30 days
0
shahviransh/fraud-detection
fraud-detection is a machine learning model from shahviransh. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
This is an ensemble fraud detection system trained on 1.47M e-commerce transactions with a 5.01% fraud rate.
Downloads · 30 days
0
Access
Public
Updated Dec 8, 2025
Repo size
25.7 GB
Likes
1
Public
Click a slice to open those files.
.pkl25.7 GB · 100%
From the Hugging Face model README
This is an ensemble fraud detection system trained on 1.47M e-commerce transactions with a 5.01% fraud rate.
Weighted Ensemble Strategy (70%-30%)
| Model | Accuracy | Precision | Recall | F1-Score | AUC-ROC |
|---|---|---|---|---|---|
| Logistic Regression | 0.5723 | 0.0988 | 0.9273 | 0.1786 | 0.8619 |
| Random Forest | 0.6203 | 0.1075 | 0.8999 | 0.1920 | 0.8712 |
| Neural Network | 0.9569 | 0.7013 | 0.2442 | 0.3623 | 0.8748 |
| XGBoost | 0.9558 | 0.6632 | 0.2389 | 0.3513 | 0.8459 |
| Stacking Ensemble | 0.8973 | 0.2640 | 0.5868 | 0.3642 | 0.8731 |
### Usage
## Warning: Need GPU environment with CUDA installed
```python
import joblib
import numpy as np
# Load models
lr_model = joblib.load("lr_model.pkl")
rf_model = joblib.load("rf_model.pkl")
nn_model = joblib.load("nn_model.pkl")
xgb_model = joblib.load("xgb_model.pkl")
ensemble_model = joblib.load("ensemble_model.pkl")
scaler = joblib.load("scaler.pkl")
# Prepare your data
df = ...
X = df[df.columns.difference(['Is Fraudulent'])].copy()
y = df['Is Fraudulent'].copy()
# Predict with ensemble
fraud_proba = ensemble_model.predict_proba(X)[:, 1]
fraud_pred = ensemble_model.predict(X)
# Evaluate predictions
evaluate_models([lr_model, rf_model, nn_model, xgb_model, ensemble_model], X, y, ['Logistic Regression', 'Random Forest', 'Neural Network', 'XGBoost', 'Stacking Ensemble'])
MIT License
COMPSCI 4AL3 - Group 34
Viransh Shah ([email protected]) Ellen Xiong ([email protected])