Instructions to use YASHR2002/fraudlens-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use YASHR2002/fraudlens-model with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("YASHR2002/fraudlens-model", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
|
Download README.md from YASHR2002/fraudlens-model: direct link, hf CLI and curl.
- Browser
- Download file 1.55 kB
-
https://huggingface.co/YASHR2002/fraudlens-model/resolve/main/README.md
- Command line
-
hf download hf://YASHR2002/fraudlens-model/README.md
-
curl -L -o README.md https://huggingface.co/YASHR2002/fraudlens-model/resolve/main/README.md
1.55 kB
| tags: | |
| - fraud-detection | |
| - tabular-classification | |
| - lightgbm | |
| - shap | |
| library_name: sklearn | |
| # FraudLens fraud detector (lightgbm, version 2) | |
| Credit card fraud scoring model from **FraudLens** (https://github.com/YASHR2002/fraudlens): leakage-free behavioural | |
| features, a cost-based decision threshold, SHAP explanations and LLM analyst notes. | |
| This repo is what the public demo API downloads at startup. | |
| | | Test set (fraudTest, used once) | Validation | | |
| |---|---|---| | |
| | PR-AUC | 0.9745 | 0.9853 | | |
| | Recall at threshold | 95.2% | 97.6% | | |
| | Precision at threshold | 86.1% | 90.1% | | |
| | Total cost (missed fraud + $5 per false alarm) | $25,150 | $2,975 | | |
| Decision threshold: **0.4326** (minimises total cost on validation). | |
| ## Contents | |
| - `champion/model/`: scikit-learn pipeline in MLflow format, serialised with **skops** | |
| (load with the trusted types listed in `fraudlens.models.estimators.SKOPS_TRUSTED_TYPES`). | |
| - `champion/metadata.json`: version, threshold, metrics, feature importance, fairness. | |
| - `features.json`: the 18 input features with plain-English descriptions. | |
| - `state/`: per-card state snapshot (end of the training data) and demo transactions. | |
| ## Data and limitations | |
| Trained on the synthetic Sparkov dataset (CC0), so scores are higher than real fraud detection | |
| would achieve; card numbers and personal fields in the demo files are synthetic. Gender is not a | |
| model input; age is, and fairness gaps by gender and age are reported in the project's model card. | |
| Not for production use. | |