This repository provides a standardized Cookiecutter template for machine learning projects. It is designed to minimize time-to-first-experiment and enforce a consistent, maintainable project structure.
- Opinionated directory structure:
data/for raw, processed, and external datasetssrc/as a Python package with models, pipelines, and utilitiesnotebooks/for exploratory researchtests/for automated testing
- Preconfigured tooling:
flake8,black,isort,mypyfor code qualitypytestfor testsMakefilewith common commands
- YAML-based configuration for experiments and models
- Minimal, SRP-oriented design ready for extension
- Python 3.11 (or compatible with your environment)
pipinstalled and available inPATHcookiecutterPython package
Install Cookiecutter:
pip install cookiecutterOn Windows, this can be run from PowerShell if Python and Scripts are on your PATH.
From any working directory, run:
cookiecutter path\to\cookiecutter-ml-templateYou will be prompted for:
project_nameproject_slugpackage_namedescriptionauthorpython_version
Cookiecutter will generate a new project in a directory named
{{ cookiecutter.project_slug }} with the following structure:
{{ cookiecutter.project_slug }}/
├── README.md
├── pyproject.toml
├── requirements.txt
├── .gitignore
├── Makefile
├── data/
├── notebooks/
├── src/
└── tests/
After generation, move into the project directory:
cd {{ cookiecutter.project_slug }}Then install dependencies:
pip install -r requirements.txtRun code quality checks:
make lintRun tests:
make testRun the baseline training pipeline:
make runThe template follows common software design principles:
- Single Responsibility Principle (SRP)
- Open/Closed Principle (OCP)
- Liskov Substitution Principle (LSP)
- Interface Segregation Principle (ISP)
- Dependency Inversion Principle (DIP)
- DRY (Don't Repeat Yourself)
- KISS (Keep It Simple, Stupid)
The aim is to keep the initial setup minimal yet extensible, allowing teams to evolve the architecture without fighting the template.
You can apply any license you prefer to your own copy or fork of this template.