Views
No views yet
1import joblib
2import pandas as pd
3from huggingface_hub import hf_hub_download
4
5# Download model
6model_path = hf_hub_download(repo_id="yahiaehab10/fraud-ccf-lightgbm", filename="pipeline.pkl")
7pipeline = joblib.load(model_path)
8
9# Download threshold
10threshold_path = hf_hub_download(repo_id="yahiaehab10/fraud-ccf-lightgbm", filename="threshold.json")
11import json
12threshold = json.load(open(threshold_path))["threshold"]
13
14# Make predictions
15# X should have columns: Amount, V1, V2, ..., V28
16probabilities = pipeline.predict_proba(X)[:, 1]
17predictions = (probabilities >= threshold).astype(int)