How bhattkaushal/timelytics works
1. What this repository is
Timelytics is a small, end-to-end machine learning project for forecasting Order-to-Delivery (OTD) time. The repo is centered on a Streamlit application for interactive prediction, backed by a pretrained ensemble model stored as voting_model.pkl.
2. Primary runtime boundary
The main user-facing boundary is streamlitApp.py. At runtime, this file serves as the app entrypoint, loads the trained model artifact, accepts order-related inputs from the user, and returns an OTD forecast. The rest of the repository mainly supports that inference path.
3. Training vs inference split
The project clearly separates offline model development from online prediction:
- Order to Delivery (OTD) Time Forecasting.ipynb appears to be the training/experimentation notebook.
- voting_model.pkl is the serialized output of that work.
This means model training is not part of the deployed app flow; the app consumes a frozen artifact.
4. Model architecture
The README states the predictor is an ensemble/voting model built from three ML algorithms: XGBoost, Random Forest, and SVM. The ensemble is the core decision layer of the system, combining multiple learners to produce the final OTD estimate.
5. Data layer
The repository includes the raw Olist ecommerce datasets in data/, such as:
- orders
- order items
- order payments
- order reviews
- customers
- products
- sellers
- category translation
These tables form the source layer for feature construction and model training. The zipped dataset file is also kept under data/, indicating the project expects local preprocessing rather than a managed data service.
6. Feature engineering and joins
Because the source data is split across multiple relational tables, the training notebook likely performs the main data integration work: joining orders with customers, products, sellers, payments, and reviews, then deriving delivery-time-related features. That preprocessing boundary is important in the architecture because the app itself probably depends on the same input schema/feature format as the notebook produced.
7. Application flow
The inference flow is likely:
user input in Streamlit → feature preparation inside streamlitApp.py → load voting_model.pkl → generate OTD prediction → display result.
No backend service, API layer, or database is present, so the app is a self-contained local ML interface.
8. Supporting UI and deployment config
The .streamlit/config.toml file customizes the Streamlit runtime, including a dark theme and disabled usage statistics. The assets/ folder contains at least one schema image used in documentation, not runtime logic. These pieces support usability and presentation but do not change the core ML architecture.
9. Environment and dependency boundary
requirements.txt and packages.txt define the Python and system-level dependencies needed for the notebook and Streamlit app. The presence of .devcontainer/ suggests the repo is also set up for containerized development, which helps reproduce the same runtime environment across machines.
10. Overall system picture
Architecturally, this is a single-machine ML application with three layers:
- data preparation/training in the notebook,
- model artifact storage in voting_model.pkl,
- interactive inference in streamlitApp.py.
There are no signs of microservices, external databases, or cloud-hosted inference endpoints; the repo is built around local execution of a packaged model over local CSV data.
Main entry points: streamlitApp.py App entry · requirements.txt Dependencies · devcontainer.json Dev container · Order to Delivery (OTD) Time Forecasting.ipynb Training notebook
Components 16
Streamlit App
Interactive OTD prediction interface and inference flow
- App entry · User-facing Streamlit entrypoint for order-to-delivery forecasting
streamlitApp.py - Input form · Collects order-related values from the user
- Feature prep · Converts submitted order data into model-ready features
- Model load · Loads the serialized voting ensemble for prediction
- Forecast output · Displays the predicted OTD time back to the user
Training
Offline notebook workflow that builds the ensemble model
- Training notebook · Experimentation and model development for OTD forecasting
Order to Delivery (OTD) Time Forecasting.ipynb - Join features · Combines order, customer, product, payment, seller, and review tables
- Ensemble train · Fits the voting ensemble from multiple learners
- Voting model · Frozen pretrained ensemble consumed by the app
voting_model.pkl
Data
Local Olist source tables used for feature building and training
- Orders data · Core order records used for feature construction
data/olist_orders_dataset.csv - Customers data · Customer dimension table used in joins
data/olist_customers_dataset.csv - Commerce tables · Order items, payments, reviews, products, and sellers tables
- Category map · Translation table for product category names
data/product_category_name_translation.csv
Environment
Runtime and development configuration
- Streamlit config · Theme and Streamlit runtime settings
.streamlit/config.toml - Dependencies · Python and system dependency manifests
requirements.txt - Dev container · Containerized development setup
.devcontainer/devcontainer.json
Connections 17
- App entry → Input form: renders · Starts the interactive order input flow
- Input form → Feature prep: submits · Collected order values are transformed into features
- Feature prep → Model load: feeds · Prepared features are passed to the pretrained model
- Model load → Forecast output: predicts · Model inference produces the forecast shown in the UI
- Training notebook → Join features: builds · Notebook assembles training features from relational source data
- Join features → Ensemble train: trains · Feature set is used to fit the ensemble learners
- Ensemble train → Voting model: exports · Training outputs the serialized voting artifact
- Orders data → Join features: input · Order records are a primary training source
- Customers data → Join features: input · Customer records are joined during feature engineering
- Commerce tables → Join features: input · Item, payment, review, product, and seller tables feed the join
- Category map → Join features: input · Category translation is used in preprocessing
- Voting model → Model load: loads · Streamlit inference consumes the saved ensemble artifact
- Streamlit config → App entry: configures · Applies Streamlit runtime and theme settings
- Dependencies → App entry: supports · Python dependencies required by the app
- Dependencies → Training notebook: supports · Notebook execution depends on the same package set
- Dev container → Dependencies: provisions · Containerized environment helps reproduce dependencies
- Dev container → App entry: provisions · Development container supports local app execution