You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement Explainable Boosting Machine (EBM) pricing model #43
We chose the Explainable Boosting Machine (EBM) as our pricing model, but it isn't implemented
yet. The recommendation endpoint still returns a placeholder.
Goal
Train an EBM on booking history and external signals. Serve real recommendations through the
existing endpoint, each with a rate, confidence interval and explanation.
Scope
Add interpret to pyproject.toml. Create services/ml/ebm.py, with EBMModel(Model) wrapping
ExplainableBoostingRegressor.
Add a feature builder shared by training and inference, with DB access via repositories
only. Features: calendar, events, weather, flights, rate vs base rate.
Add a training script with a time-based split that saves a model artifact. Put the artifact
path in config.py.
Wire the model into GET /hotels/{id}/recommendations. Return the rate, a conformal
confidence interval and the top contributing terms as the explanation.
Add EBM to compare_models.py.
Acceptance criteria
Training script reports MAE/RMSE/R² and saves a loadable artifact.
Endpoint returns a model-generated rate, interval and explanation in the agreed shape.
Missing model or too little history returns a clear error, not a 500.
No route or service touches the session directly.
Tests cover the model, the feature builder and the endpoint (happy path + 404).
Activity