Views
No views yet
champion_meta.json).| Metric | Value |
|---|---|
| F1 | 0.8046506137865911 |
| ROC-AUC | 0.9384035807110922 |
| Precision | 0.841708852944808 |
| Recall | 0.7707179197286602 |
| Accuracy | 0.8613786749308987 |
1from huggingface_hub import snapshot_download
2import joblib, json, pandas as pd
3
4local_dir = snapshot_download(repo_id="j2damax/hotel-cancel-model")
5model = joblib.load(f"{local_dir}/champion_model.pkl")
6preprocessor = joblib.load(f"{local_dir}/preprocessor.pkl")
7meta = json.load(open(f"{local_dir}/champion_meta.json"))
8
9sample = pd.DataFrame([{
10 'lead_time': 45, 'arrival_month': 7, 'adults': 2, 'children': 0, 'adr': 110.0
11}])
12
13X = preprocessor.transform(sample)
14proba = float(model.predict_proba(X)[:,1][0])
15print('Cancellation probability:', round(proba, 4))champion_model.pkl – serialized champion estimatorpreprocessor.pkl – unified preprocessing / feature pipelinechampion_meta.json – metrics & threshold