Skip to content

Implement Explainable Boosting Machine (EBM) pricing model #43

Closed

Description

@selvarajuv

Problem

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

  1. self-assigned this
    on Oct 12, 2026
  2. linked a pull request that will close this issuefeat: implement EBM (and other things) #49on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

featureIntroduces a new and complete feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions