Downloads · 30 days
0
j2damax/hotel-cancel-model
hotel-cancel-model is a tabular classification model from j2damax. Use it for the tabular classification task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Predicts probability that a hotel booking will be cancelled (Sri Lankan hospitality context). The champion model is XGBoost; threshold based decisions currently use 0.35000000000000003 (see championmeta.json).
Downloads · 30 days
0
Access
Public
Updated Oct 8, 2025
Repo size
341 KB
Likes
1
Public
Click a slice to open those files.
.json13 KB · 55%
From the Hugging Face model README
Predicts probability that a hotel booking will be cancelled (Sri Lankan hospitality context). The champion model is XGBoost; threshold based decisions currently use 0.35000000000000003 (see champion_meta.json).
Last updated: 2025-10-05 16:43 UTC
| Metric | Value |
|---|---|
| F1 | 0.8046506137865911 |
| ROC-AUC | 0.9384035807110922 |
| Precision | 0.841708852944808 |
| Recall | 0.7707179197286602 |
| Accuracy | 0.8613786749308987 |
from huggingface_hub import snapshot_download
import joblib, json, pandas as pd
local_dir = snapshot_download(repo_id="j2damax/hotel-cancel-model")
model = joblib.load(f"{local_dir}/champion_model.pkl")
preprocessor = joblib.load(f"{local_dir}/preprocessor.pkl")
meta = json.load(open(f"{local_dir}/champion_meta.json"))
sample = pd.DataFrame([{
'lead_time': 45, 'arrival_month': 7, 'adults': 2, 'children': 0, 'adr': 110.0
}])
X = preprocessor.transform(sample)
proba = float(model.predict_proba(X)[:,1][0])
print('Cancellation probability:', round(proba, 4))
champion_model.pkl – serialized champion estimatorpreprocessor.pkl – unified preprocessing / feature pipelinechampion_meta.json – metrics & thresholdModel trained with stratified 5-fold CV; primary selection metric: F1; tie-breaker: ROC-AUC. Class imbalance handled via class weights.
Academic coursework (NIB 7072) — Sri Lankan tourism cancellation risk analysis.