How yash176a/pricing-engine works
This is a synthetic-market dynamic pricing engine: it generates noisy historical observations, fits a demand model, and selects prices to maximize modeled profit. Its evaluation scores the optimized policy against the market’s true demand function, then can register and promote the trained model. The serving API resolves the production model for demand predictions and price recommendations. The graph follows the sampled training, evaluation, registry, optimizer, and service code; other README capabilities are included only where documented, and no unsampled implementation details are assumed.
Main entry points: train.py Training and evaluation · service.py FastAPI service · optimizer.py Price optimizer · run_eval.py Evaluation runner
Components 12
Market and evaluation
- Synthetic market
src/pricing_engine/data.py - Training and evaluation
src/pricing_engine/train.py - Evaluation runner
eval/run_eval.py - True demand function
src/pricing_engine/data.py
Pricing models
- Demand model
src/pricing_engine/demand_model.py - Price optimizer
src/pricing_engine/optimizer.py - Runtime settings
src/pricing_engine/config.py
Model registry
- Versioned model registry
src/pricing_engine/registry.py - Registry files
src/pricing_engine/registry.py
Serving interface
- Command-line interface
src/pricing_engine/cli.py - FastAPI service
src/pricing_engine/service.py
Other components
- Operator / API client
Connections 18
- Operator / API client → Command-line interface: runs commands
README.md - Operator / API client → FastAPI service: sends requests
README.md - Command-line interface → Evaluation runner: runs evaluation
src/pricing_engine/cli.py - Command-line interface → FastAPI service: starts server
src/pricing_engine/cli.py - Evaluation runner → Training and evaluation: trains and evaluates
eval/run_eval.py - Evaluation runner → Versioned model registry: registers and promotes
eval/run_eval.py - Training and evaluation → Synthetic market: generates market
src/pricing_engine/train.py - Training and evaluation → Demand model: fits model
src/pricing_engine/train.py - Training and evaluation → Price optimizer: chooses prices
src/pricing_engine/train.py - Training and evaluation → True demand function: scores policies
src/pricing_engine/train.py - Synthetic market → True demand function: generates observations
src/pricing_engine/data.py - Price optimizer → Demand model: queries predictions
src/pricing_engine/optimizer.py - Versioned model registry → Registry files: persists artifacts
src/pricing_engine/registry.py - FastAPI service → Versioned model registry: resolves and loads
src/pricing_engine/service.py - FastAPI service → Price optimizer: optimizes prices
src/pricing_engine/service.py - FastAPI service → Demand model: predicts demand
src/pricing_engine/service.py - Runtime settings → Training and evaluation: sets training parameters
src/pricing_engine/train.py - Runtime settings → Price optimizer: sets price bounds
src/pricing_engine/optimizer.py