Skip to content

Rebuild pricing pipeline with leakage-safe demand modeling and scenario analysis - #1

Merged
muditgmac merged 12 commits into
mainfrom
fix-training-pipeline
Sep 27, 2026
Merged

muditgmac merged 12 commits into
mainfrom
fix-training-pipeline

Conversation

@muditgmac

Copy link
Copy Markdown
Owner

Summary

This PR substantially rebuilds the dynamic pricing project around a more defensible modeling architecture.

The previous implementation estimated observational price elasticity and used it directly for price optimization. That approach has been retired. The updated system separates predictive modeling from pricing assumptions:

  • XGBoost predicts a calendar-unavailability demand proxy.
  • Model evaluation uses leakage-safe chronological validation and a strictly later future holdout.
  • Pricing recommendations are produced through explicit low, moderate, and high price-sensitivity scenarios rather than claimed causal elasticity.
  • TreeSHAP provides prediction explanations.
  • Isolation Forest provides anomaly detection.
  • FastAPI and Streamlit now expose the scenario-based workflow.
  • MLflow uses a SQLite tracking backend.
  • Docker and CI have been hardened and validated end-to-end.

Key changes

  • Rebuilt the demand model with temporal evaluation and leakage controls.
  • Removed the legacy elasticity estimator and optimizer.
  • Added the assumption-based pricing scenario engine.
  • Added production model-training orchestration.
  • Migrated API schemas, routes, dependencies, and dashboard.
  • Updated model experiment and pricing notebooks.
  • Improved data ingestion and feature engineering.
  • Added Docker reliability improvements and runtime health checks.
  • Rewrote the README around the current architecture and modeling limitations.
  • Expanded tests for production training and drift-monitoring workflows.
  • Raised the CI coverage floor from 70% to 75%.

Validation

Current local validation:

  • 144 tests passing
  • 81.55% measured coverage
  • 75% CI coverage threshold
  • Ruff clean
  • pip check clean
  • Docker API and dashboard images successfully built
  • XGBoost, LightGBM, pandas, and MLflow successfully imported inside the Linux API container
  • API /health returned 200 with production models loaded
  • Streamlit dashboard returned 200
  • git diff --check origin/main...HEAD clean

Modeling boundary

The system does not claim to estimate causal price elasticity from observational Airbnb data.

Calendar unavailability is treated as a demand proxy, and pricing outputs are conditional scenario results under explicitly stated sensitivity assumptions. Revenue values are therefore scenario-based proxies rather than claims about realized causal revenue uplift.

@muditgmac
muditgmac merged commit b8e2c92 into main Sep 27, 2026
2 checks passed
@muditgmac
muditgmac deleted the fix-training-pipeline branch September 27, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant