Skip to content

mooceanstudio/data-science-projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Science Projects in Python

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.

Projects

# 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.

Setup

Requires Python 3.12.

python -m venv .venv
source .venv/bin/activate          # Windows: .venv\Scripts\activate
pip install -r requirements.txt

Or with the Makefile:

make venv        # create .venv and install requirements

Running the projects

Each 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 three

Directly, 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.py

Generated CSVs, charts, and model files land in each project's data/, outputs/, and model/ folders — all git-ignored and reproducible.

Tests

make test        # or: python -m pytest -q

The 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.

What each project demonstrates

  • Project A — vectorised synthetic data generation, pandas group-bys and pivot tables, time resampling, and a reusable matplotlib chart style.
  • Project B — a leak-free Pipeline with a ColumnTransformer (scaling + one-hot), stratified train/test split, LogisticRegression vs RandomForest, evaluation (accuracy, precision, recall, ROC-AUC, confusion matrix), and model persistence with joblib.
  • Project CDatetimeIndex handling, rolling windows, and an additive trend/seasonal/residual decomposition.

Results summary

  • 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.

Project layout

data-science-projects/
├── projects/
│   ├── 01_sales_eda/
│   ├── 02_churn_classifier/
│   └── 03_timeseries/
├── notebooks/
├── src/
├── tests/
├── requirements.txt
├── Makefile
└── README.md

License

Released under the MIT License.

About

Data science projects in Python — exploratory analysis, visualization, and machine-learning pipelines with pandas and scikit-learn

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors