dineth554 commited on
Commit
1ec3568
ยท
verified ยท
1 Parent(s): cc4955d

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +67 -43
README.md CHANGED
@@ -1,16 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
  # ๐Ÿ”ฅ Death Legion Fraud Detection System
2
 
3
  <p align="center">
4
- <img src="https://img.shields.io/badge/Death%20Legion-Powered-red?style=for-the-badge&logo=skull" alt="Death Legion">
5
- <img src="https://img.shields.io/badge/Best%20Teams-Elite-gold?style=for-the-badge&logo=crown" alt="Best Teams">
6
- <img src="https://img.shields.io/badge/AUPRC-0.8177-success?style=for-the-badge" alt="AUPRC">
7
- <img src="https://img.shields.io/badge/Model%20Size-6.12MB-blue?style=for-the-badge" alt="Size">
8
  </p>
9
 
10
  ## ๐ŸŽฏ Overview
11
 
12
  Welcome to the **Death Legion Fraud Detection System** - a state-of-the-art machine learning solution for real-time credit card fraud detection. Built by the **Best Teams** with cutting-edge Random Forest technology, this model achieves exceptional performance on highly imbalanced financial datasets.
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  ## โšก Key Features
15
 
16
  - **๐Ÿ›ก๏ธ Advanced Random Forest Architecture**: 500 estimators with optimized depth
@@ -39,52 +67,50 @@ Random Forest Classifier
39
  โ””โ”€โ”€ Format: Safetensors (6.12 MB)
40
  ```
41
 
42
- ## ๐Ÿš€ Quick Start
43
-
44
- ### Installation
45
-
46
- ```bash
47
- pip install safetensors numpy pandas scikit-learn
48
- ```
49
 
50
- ### Loading the Model
51
 
52
- ```python
53
- from safetensors.numpy import load_file
54
- import numpy as np
55
 
56
- # Load model
57
- tensors = load_file("fraud_detector.safetensors")
58
 
59
- # Access metadata
60
- n_estimators = int(tensors['metadata/n_estimators'][0])
61
- print(f"Loaded model with {n_estimators} trees")
62
- ```
63
 
64
- ### Making Predictions
65
 
66
  ```python
67
- # Your transaction features (30 features: V1-V28, Time, Amount)
68
- features = np.array([[...]]) # Shape: (1, 30)
69
-
70
- # Load and predict using the inference script
71
- from inference import load_artifacts_safetensors, predict
72
 
73
- model, scaler = load_artifacts_safetensors()
74
- predictions, probabilities = predict(model, scaler, features)
 
 
 
 
75
 
76
- print(f"Fraud Probability: {probabilities[0]:.4f}")
77
- print(f"Prediction: {'FRAUD' if predictions[0] == 1 else 'LEGITIMATE'}")
 
78
  ```
79
 
80
  ## ๐Ÿ“ Repository Structure
81
 
82
  ```
 
 
 
 
 
83
  Pnny13/fraud-detection-model/
84
- โ”œโ”€โ”€ fraud_detector.safetensors # Trained model (6.12 MB)
85
- โ”œโ”€โ”€ scaler.joblib # Feature scaler
86
- โ”œโ”€โ”€ inference.py # Prediction script
87
- โ””โ”€โ”€ README.md # This file
88
  ```
89
 
90
  ## ๐Ÿ”ฌ Technical Details
@@ -118,13 +144,13 @@ Try the live interactive demo at: **https://huggingface.co/spaces/Pnny13/fraud-d
118
  ## ๐Ÿค Credits
119
 
120
  <p align="center">
121
- <strong>Powered by Death Legion</strong><br>
122
- <em>Elite Machine Learning Division</em>
123
  </p>
124
 
125
  <p align="center">
126
- <strong>Best Teams Collaboration</strong><br>
127
- <em>Excellence in AI Engineering</em>
128
  </p>
129
 
130
  ## ๐Ÿ“œ License
@@ -137,8 +163,6 @@ This model is released under the MIT License. Use responsibly for fraud detectio
137
  - ๐Ÿš€ Space: https://huggingface.co/spaces/Pnny13/fraud-detection-space
138
  - ๐Ÿ“Š Dataset: https://www.kaggle.com/datasets/mlg-ulb/creditcardfraud
139
 
140
- ---
141
-
142
  <p align="center">
143
- <sub>Built with ๐Ÿ”ฅ by Death Legion | Best Teams Elite Division</sub>
144
- </p>
 
1
+ ---
2
+ title: "Death Legion Fraud Detection"
3
+ emoji: "๐Ÿ”ฅ"
4
+ colorFrom: "red"
5
+ colorTo: "red"
6
+ sdk: "gradio"
7
+ sdk_version: "4.19.0"
8
+ python_version: "3.10"
9
+ app_file: "app.py"
10
+ pinned: false
11
+ ---
12
+
13
  # ๐Ÿ”ฅ Death Legion Fraud Detection System
14
 
15
  <p align="center">
16
+ <img src="https://img.shields.io/badge/Death%20Legion-Powered-red?style=for-the-badge&logo=skull" alt="Death Legion">
17
+ <img src="https://img.shields.io/badge/Best%20Teams-Elite-gold?style=for-the-badge&logo=crown" alt="Best Teams">
18
+ <img src="https://img.shields.io/badge/AUPRC-0.8177-success?style=for-the-badge" alt="AUPRC">
19
+ <img src="https://img.shields.io/badge/Model%20Size-6.12MB-blue?style=for-the-badge" alt="Size">
20
  </p>
21
 
22
  ## ๐ŸŽฏ Overview
23
 
24
  Welcome to the **Death Legion Fraud Detection System** - a state-of-the-art machine learning solution for real-time credit card fraud detection. Built by the **Best Teams** with cutting-edge Random Forest technology, this model achieves exceptional performance on highly imbalanced financial datasets.
25
 
26
+ ## ๐Ÿš€ Deploy This Space
27
+
28
+ <p align="center">
29
+ <a href="https://huggingface.co/spaces/Pnny13/fraud-detection-space?duplicate=true">
30
+ <img src="https://img.shields.io/badge/๐Ÿš€%20Deploy%20to%20HF-Spaces-blue?style=for-the-badge" alt="Deploy to Hugging Face">
31
+ </a>
32
+ </p>
33
+
34
+ ## ๐ŸŽฎ Use This Model
35
+
36
+ <p align="center">
37
+ <a href="https://huggingface.co/Pnny13/fraud-detection-model">
38
+ <img src="https://img.shields.io/badge/๐Ÿค—%20Use%20This%20Model-Hugging%20Face-yellow?style=for-the-badge" alt="Use This Model">
39
+ </a>
40
+ </p>
41
+
42
  ## โšก Key Features
43
 
44
  - **๐Ÿ›ก๏ธ Advanced Random Forest Architecture**: 500 estimators with optimized depth
 
67
  โ””โ”€โ”€ Format: Safetensors (6.12 MB)
68
  ```
69
 
70
+ ## ๐Ÿ“– How to Use
 
 
 
 
 
 
71
 
72
+ ### Quick Start
73
 
74
+ 1. **Access the Live Demo**: Visit [https://huggingface.co/spaces/Pnny13/fraud-detection-space](https://huggingface.co/spaces/Pnny13/fraud-detection-space)
 
 
75
 
76
+ 2. **Enter Transaction Features**: Input the 30 features (V1-V28, Time, Amount) from your credit card transaction
 
77
 
78
+ 3. **Get Instant Prediction**: The system will return:
79
+ - Fraud probability score (0-100%)
80
+ - Binary classification (Fraud/Legitimate)
81
+ - Recommendation for action
82
 
83
+ ### Programmatic Usage
84
 
85
  ```python
86
+ from safetensors.numpy import load_file
87
+ import numpy as np
 
 
 
88
 
89
+ # Load model from Hugging Face Hub
90
+ from huggingface_hub import hf_hub_download
91
+ model_path = hf_hub_download(
92
+ repo_id="Pnny13/fraud-detection-model",
93
+ filename="fraud_detector.safetensors"
94
+ )
95
 
96
+ # Load and predict
97
+ tensors = load_file(model_path)
98
+ # ... use model for predictions
99
  ```
100
 
101
  ## ๐Ÿ“ Repository Structure
102
 
103
  ```
104
+ Pnny13/fraud-detection-space/
105
+ โ”œโ”€โ”€ app.py # Gradio application
106
+ โ”œโ”€โ”€ requirements.txt # Python dependencies
107
+ โ””โ”€โ”€ README.md # Documentation
108
+
109
  Pnny13/fraud-detection-model/
110
+ โ”œโ”€โ”€ fraud_detector.safetensors # Trained model
111
+ โ”œโ”€โ”€ scaler.joblib # Feature scaler
112
+ โ”œโ”€โ”€ inference.py # Prediction script
113
+ โ””โ”€โ”€ README.md # Model documentation
114
  ```
115
 
116
  ## ๐Ÿ”ฌ Technical Details
 
144
  ## ๐Ÿค Credits
145
 
146
  <p align="center">
147
+ <strong>Powered by Death Legion</strong><br>
148
+ <em>Elite Machine Learning Division</em>
149
  </p>
150
 
151
  <p align="center">
152
+ <strong>Best Teams Collaboration</strong><br>
153
+ <em>Excellence in AI Engineering</em>
154
  </p>
155
 
156
  ## ๐Ÿ“œ License
 
163
  - ๐Ÿš€ Space: https://huggingface.co/spaces/Pnny13/fraud-detection-space
164
  - ๐Ÿ“Š Dataset: https://www.kaggle.com/datasets/mlg-ulb/creditcardfraud
165
 
 
 
166
  <p align="center">
167
+ <sub>Built with ๐Ÿ”ฅ by Death Legion | Best Teams Elite Division</sub>
168
+ </p>