How grupo-57-machine-learning-engineering/purchase-propensity works
Purchase Propensity is an end-to-end purchase-intent ML system: it prepares browsing data, trains and compares classifiers, promotes a champion model, and serves predictions through FastAPI. The main training flow is owned by the experiment runner; a separate Random Forest search supports tuning. The API loads the registered champion at startup and scores submitted visits. Relationships below are limited to the excerpts, SOURCE INDEX references, and README statements; unsampled implementation details are not inferred.
Main entry points: experiment.py Experiment runner · src/pipeline.py Pipeline runner · data/pipeline.py ETL orchestrator · registry.py Champion registry
Components 26
Data preparation
- Raw visits
data/raw - ETL orchestrator
src/data/pipeline.py - Dataset extraction
src/data/extract.py - Dataset transform
src/data/transform.py - Processed parquet
data/processed
Model training
- Pipeline runner
src/pipeline.py - Feature selection
src/features/selection.py - Stratified split
src/training/split.py - Experiment runner
src/training/experiment.py - Baseline training
src/training/baseline.py - Logistic regression
src/models/logistic_regression.py - Forest training
src/training/random_forest.py - Random Forest
src/models/random_forest.py - Cross-validation
src/training/cross_validation.py - Metrics
src/training/metrics.py - Hyperparameter search
src/training/tuning.py - Run tracking
src/training/tracking.py
Model selection
- Run comparison
src/training/compare.py - Champion registry
src/training/registry.py - MLflow service
Prediction API
- FastAPI endpoints
src/api/app.py - Model loading and scoring
src/api/model.py - Request and response schemas
src/api/schemas.py
Other components
- ML practitioner
- Kaggle dataset
- Prediction client
Connections 29
- ML practitioner → Pipeline runner: runs pipeline
src/pipeline.py - Kaggle dataset → Dataset extraction: provides dataset
README.md - ETL orchestrator → Dataset extraction: calls extraction
src/data/pipeline.py - Dataset extraction → Raw visits: downloads raw
README.md - ETL orchestrator → Dataset transform: transforms data
src/data/pipeline.py - ETL orchestrator → Processed parquet: writes parquet
src/data/pipeline.py - Pipeline runner → ETL orchestrator: runs ETL
src/pipeline.py - Pipeline runner → Experiment runner: runs experiments
src/pipeline.py - Pipeline runner → Champion registry: promotes model
src/pipeline.py - Experiment runner → Processed parquet: reads dataset
src/training/experiment.py - Experiment runner → Stratified split: creates split
src/training/experiment.py - Stratified split → Feature selection: selects features
src/training/split.py - Baseline training → Experiment runner: runs experiment
src/training/baseline.py - Baseline training → Logistic regression: builds estimator
src/training/baseline.py - Forest training → Experiment runner: runs experiment
src/training/random_forest.py - Forest training → Random Forest: builds estimator
src/training/random_forest.py - Experiment runner → Cross-validation: validates folds
src/training/experiment.py - Experiment runner → Metrics: saves metrics
src/training/experiment.py - Experiment runner → Run tracking: logs run
README.md - Hyperparameter search → Random Forest: searches parameters
src/training/tuning.py - Hyperparameter search → Stratified split: prepares data
src/training/tuning.py - Run tracking → MLflow service: logs runs
README.md - Champion registry → Run comparison: ranks runs
src/training/registry.py - Champion registry → MLflow service: registers champion
src/training/registry.py - Prediction client → FastAPI endpoints: requests prediction
README.md - FastAPI endpoints → Model loading and scoring: loads and scores
src/api/app.py - FastAPI endpoints → Request and response schemas: validates payloads
src/api/app.py - Model loading and scoring → Request and response schemas: uses visitor fields
src/api/model.py - Model loading and scoring → MLflow service: loads champion
src/api/model.py