Spaces:
Sleeping
Sleeping
Download Model Performance.py from yekkala/FraudSentinelX: direct link, hf CLI and curl.
- Browser
- Download file 494 Bytes
-
https://huggingface.co/spaces/yekkala/FraudSentinelX/resolve/main/Model%20Performance.py
- Command line
-
hf download 'hf://spaces/yekkala/FraudSentinelX/Model Performance.py'
-
curl -L -o 'Model Performance.py' https://huggingface.co/spaces/yekkala/FraudSentinelX/resolve/main/Model%20Performance.py
494 Bytes
| import matplotlib.pyplot as plt | |
| class FraudDetection: | |
| def plot_model_performance(self): | |
| # Example: Plot confusion matrix | |
| plt.figure(figsize=(5, 4)) | |
| plt.imshow([[0.9, 0.1], [0.2, 0.8]]) | |
| plt.colorbar() | |
| plt.xlabel("Predicted") | |
| plt.ylabel("Actual") | |
| plt.title("Confusion Matrix") | |
| buf = io.BytesIO() | |
| plt.savefig(buf, format='png') | |
| plt.close() | |
| buf.seek(0) | |
| image = Image.open(buf) | |
| return image |