A newer version of the Streamlit SDK is available:
1.52.2
metadata
title: E-Commerce Fraud Detection
emoji: π‘οΈ
colorFrom: blue
colorTo: purple
sdk: streamlit
sdk_version: 1.28.1
app_file: app.py
pinned: false
license: mit
tags:
- fraud-detection
- machine-learning
- streamlit
- e-commerce
- security
datasets:
- fraud-detection-dataset
π‘οΈ E-Commerce Fraud Detection System
A Streamlit app for real-time e-commerce fraud detection using machine learning and explainable AI.
π Features
- Real-time fraud risk assessment
- Explainable AI (feature impact)
- Interactive analytics dashboard
- Modular, production-ready code
ποΈ Project Structure
app.py
pages/
home.py
fraud_detection.py
model_insights.py
analytics_dashboard.py
utils/
model_utils.py
preprocessing.py
visualization.py
requirements.txt
lightgbm_model.pkl
customer_loc.pkl
βοΈ Configuration
Hugging Face Space Configuration
For optimal deployment on Hugging Face Spaces, ensure your repository includes:
Space Metadata (README.md)
---
title: E-Commerce Fraud Detection
emoji: π‘οΈ
colorFrom: blue
colorTo: purple
sdk: streamlit
sdk_version: 1.28.1
app_file: app.py
pinned: false
license: mit
---
Space Configuration (README.md)
Add this section to your README for better Space discovery: ```yaml
tags: - fraud-detection - machine-learning - streamlit - e-commerce - security datasets: - fraud-detection-dataset
## π§βπ» Local Development
1. Install dependencies:
```bash
pip install -r requirements.txt
- Run the app:
streamlit run app.py
π³ Docker Deployment
You can also run this app in a Docker container:
- Build the Docker image:
docker build -t fraudlens-app . - Run the container:
docker run -p 8501:8501 fraudlens-app
The app will be available at http://localhost:8501.
π Deploy on Hugging Face Spaces
- Push this repo (with all files, including .pkl models) to a public GitHub repository.
- Create a new Space on Hugging Face Spaces and select Streamlit as the SDK.
- In "Repository URL", enter your GitHub repo URL.
- The app will build and deploy automatically!
Note: For Docker-based Spaces, select the Docker SDK and ensure your Dockerfile is present in the repo.
Space Configuration Files
- app.py: Main Streamlit application entry point
- requirements.txt: Python dependencies
- Dockerfile: For Docker-based deployment
- README.md: Space metadata and documentation
π¦ Requirements
All dependencies are listed in requirements.txt.
π License
MIT