A small, self-contained collection of data science projects that demonstrate an
end-to-end workflow in Python: data wrangling, exploratory analysis,
visualization, and machine learning with pandas, numpy, matplotlib, and
scikit-learn.
Every project ships its own deterministic data generator, so the repo stays clean (no committed data or artifacts) and everything is reproducible from source with a single command.
| # | Project | Focus | Key libraries |
|---|---|---|---|
| A | projects/01_sales_eda |
Exploratory data analysis of retail sales — group-bys, pivots, charts. | pandas, numpy, matplotlib |
| B | projects/02_churn_classifier |
Supervised ML pipeline predicting customer churn, with model comparison and evaluation. | scikit-learn, joblib |
| C | projects/03_timeseries |
Time-series analysis — rolling stats and additive seasonal decomposition. | pandas, numpy, matplotlib |
There is also a narrated Jupyter notebook in
notebooks/ that walks through the churn
project step by step, and shared helpers in src/ reused across projects
and tests.
Requires Python 3.12.
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txtOr with the Makefile:
make venv # create .venv and install requirementsEach project is a generate_data.py (synthesises input) plus one or more
analysis/training scripts. Run them individually, or use the Makefile targets
(which assume the environment is active):
make sales # Project A: generate data + EDA charts
make churn # Project B: generate data + train + predict
make timeseries # Project C: generate data + analysis charts
make all # all threeDirectly, for Project B for example:
python projects/02_churn_classifier/generate_data.py
python projects/02_churn_classifier/train.py
python projects/02_churn_classifier/predict.pyGenerated CSVs, charts, and model files land in each project's
data/, outputs/, and model/ folders — all git-ignored and reproducible.
make test # or: python -m pytest -qThe suite covers the shared metric/utility functions and checks that each data generator produces the expected shape, schema, and deterministic output, plus a light integration test of the churn pipeline.
- Project A — vectorised synthetic data generation,
pandasgroup-bys and pivot tables, time resampling, and a reusablematplotlibchart style. - Project B — a leak-free
Pipelinewith aColumnTransformer(scaling + one-hot), stratified train/test split,LogisticRegressionvsRandomForest, evaluation (accuracy, precision, recall, ROC-AUC, confusion matrix), and model persistence withjoblib. - Project C —
DatetimeIndexhandling, rolling windows, and an additive trend/seasonal/residual decomposition.
- Sales EDA surfaces a volume-versus-value split (Grocery/Home lead on order count, Electronics on revenue), an online-vs-in-store channel gap, and a clear Q4 seasonal uplift.
- Churn classifier recovers genuine signal from the synthetic data, with
both models typically reaching ~0.80+ ROC-AUC on the held-out test set;
exact figures are written to
model/metrics.json. - Time-series analysis cleanly separates a steady upward trend from strong weekly seasonality, leaving a residual centred near zero.
data-science-projects/
├── projects/
│ ├── 01_sales_eda/
│ ├── 02_churn_classifier/
│ └── 03_timeseries/
├── notebooks/
├── src/
├── tests/
├── requirements.txt
├── Makefile
└── README.md
Released under the MIT License.