Views
No views yet
0.972740.722980.000%.joblib artifact which bundles the model weights, the probability calibration mapping, and the exact production feature order.1import joblib
2import xgboost as xgb
3from huggingface_hub import hf_hub_download
4
5# 1. Download from Hub
6model_path = hf_hub_download(
7 repo_id="xNub/xgboost-fraud-detection-calibrated",
8 filename="calibrated_fraud_model.joblib"
9)
10
11# 2. Load the pipeline components
12artifacts = joblib.load(model_path)
13model = artifacts["model"]
14calibrator = artifacts["calibrator"]
15features = artifacts["features"]
16
17# 3. Predict & Calibrate
18# dmatrix = xgb.DMatrix(df[features])
19# raw_predictions = model.predict(dmatrix)
20# calibrated_probabilities = calibrator.predict(raw_predictions)