A compact analytics project for retail packaged-oil sales. The repository contains data cleaning and EDA notebooks, baseline predictive modeling, a Streamlit dashboard for interactive exploration, and a small utility to generate an executive PDF report.
app.py— Streamlit dashboard for interactive exploration (launch withstreamlit run app.py).data/cleaned_data.csv— cleaned dataset snapshot used by notebooks and scripts.notebooks/— Jupyter notebooks for reproducibility:01_data_cleaning.ipynb— data cleaning and preprocessing.02_eda.ipynb— exploratory data analysis and visualizations.03_modeling.ipynb— model experiments and evaluation.
scripts/— helper scripts:data_cleaning.py— programmatic cleaning utilities.eda.py— scripts that reproduce EDA charts.modeling.py— model training and evaluation entrypoints.generate_report.py— generatesoutputs/sales_report.pdf(concise executive summary).
outputs/— generated artifacts (PDF reports, charts, model artifacts).requirements.txt— pinned Python dependencies used for the project.
- Create and activate a virtual environment:
python -m venv .venv
.\.venv\Scripts\Activate.ps1- Install dependencies:
python -m pip install -r .\requirements.txt- Run the Streamlit dashboard:
python -m streamlit run app.py
# or
streamlit run app.py- Regenerate the executive PDF report:
python scripts\generate_report.py
# output: outputs\sales_report.pdf- Cleaning: numeric coercion for sales/price/size, drop rows missing
value_sales, construct adatecolumn fromyearandmonthwhere available. - Analysis: aggregate metrics (total value/volume, top cities/brands), monthly seasonality analysis.
- Baseline model: a RandomForestRegressor baseline is provided as a robust starting point. Use a time-based train/validation split for production forecasting and add lag features, promotions, and external signals to improve performance.
- Move from random holdout to time-based validation (walk-forward) to avoid lookahead bias.
- Add lag features (previous-month sales), rolling statistics, and store-level history.
- Include binary flags for promotions, holidays, and price changes; incorporate external signals where available.
- Automate model retraining (e.g., monthly) and expose forecasts through the dashboard or an API.
The PDF generator (scripts/generate_report.py) uses ReportLab and currently produces a concise executive summary. It can be extended to embed PNG charts (monthly seasonality, top-city bar charts) or to output multiple report formats (HTML, PPTX).
Add your preferred license file (e.g., LICENSE) and a contact email or maintainer details here.
If you want, I can:
- Commit this
README.md(already written to disk) and push further edits. - Shorten or expand any section, or add sample screenshots of the Streamlit app.
- Add a
CONTRIBUTING.mdorLICENSEfile. pandas numpy matplotlib seaborn scikit-learn