How hhaarrss/dynamic-pricing-engine works
This is a dynamic-pricing engine: product and market inputs lead to price recommendations from a LinUCB agent, served through FastAPI and presented in a Streamlit dashboard. A separate data workflow scrapes Amazon listings, cleans them, and supports feature engineering; the README also documents XGBoost demand forecasting, SHAP explanations, MLflow tracking, and strategy backtesting. The graph distinguishes documented capabilities from source-confirmed calls. Some feature-pipeline wiring and backtester integration are not shown in the excerpts, so those links are omitted rather than inferred.
Main entry points: features.csv Engineered Features · main.py Pricing API · predict.py Pricing Predictor · amazon_scraper.py Amazon Scraper
Components 21
Market Data
- Amazon Scraper
scraper/amazon_scraper.py - Raw Price Store
data/database.db - Data Cleaner
scraper/cleaner.py - Scrape Scheduler
scraper/scheduler.py - Cleaned Prices
data/processed/cleaned_prices.csv
Feature Engineering
- Demand Signals
features/demand_signals.py - Competitor Gaps
features/competitor_gap.py - Price Elasticity
features/elasticity.py - Engineered Features
data/processed/features.csv
Modeling
- Demand Forecaster
models/demand_forecaster.py - LinUCB Agent
models/rl_agent.py
Price Serving
- Pricing API
api/main.py - Pricing Predictor
api/predict.py - API Schemas
api/schemas.py - Health Endpoint
api/health.py - Pricing Dashboard
dashboard/app.py
Strategy Analysis
- Strategy Backtester
models/backtester.py - MLflow Tracking
mlflow_tracking - SHAP Results
data/processed/shap_values.csv
Other components
- Pricing User
- Amazon Listings
Connections 26
- Amazon Listings → Amazon Scraper: scrapes
README.md - Scrape Scheduler → Amazon Scraper: runs
scraper/scheduler.py - Scrape Scheduler → Data Cleaner: runs
scraper/scheduler.py - Amazon Scraper → Raw Price Store: writes listings
scraper/amazon_scraper.py - Data Cleaner → Raw Price Store: reads
scraper/cleaner.py - Data Cleaner → Cleaned Prices: writes
scraper/cleaner.py - Amazon Scraper → Data Cleaner: followed by
scraper/scheduler.py - Cleaned Prices → Demand Signals: input
features/demand_signals.py - Cleaned Prices → Competitor Gaps: input
features/competitor_gap.py - Demand Signals → Engineered Features: updates
features/demand_signals.py - Competitor Gaps → Engineered Features: updates
features/competitor_gap.py - Price Elasticity → Engineered Features: writes
- Engineered Features → Demand Forecaster: trains from
models/demand_forecaster.py - Demand Forecaster → MLflow Tracking: logs experiments
models/demand_forecaster.py - Demand Forecaster → SHAP Results: writes explanations
models/demand_forecaster.py - Engineered Features → LinUCB Agent: trains from
models/rl_agent.py - Engineered Features → Strategy Backtester: evaluates strategies
README.md - Pricing User → Pricing Dashboard: submits inputs
dashboard/app.py - Pricing Dashboard → Pricing API: requests price
dashboard/app.py - Pricing Dashboard → Health Endpoint: checks health
dashboard/app.py - Pricing API → Pricing Predictor: calls
api/main.py - Pricing API → Health Endpoint: registers route
api/main.py - Pricing API → API Schemas: validates
api/main.py - Pricing Predictor → API Schemas: uses types
api/predict.py - Pricing Predictor → LinUCB Agent: scores actions
api/predict.py - Pricing Predictor → Engineered Features: loads features
api/predict.py