Skip to content

A cookiecutter template for machine learning projects

License

Notifications You must be signed in to change notification settings

00mjk/cookiecutter-ml-template

Repository files navigation

Cookiecutter Machine Learning

forthebadge forthebadge forthebadge

Linux build status on Travis CI License: MIT

Summary

This project is an opinionated template for ML projects which creates package skeletons.

Once generated, the package skeletons have the following features:

  • Good base folder structure for many kinds of ML Projects
  • CI testing (travis, tox and pytest)
  • Automated building, versioning and hosting of documentation (sphinx on github pages)
  • using pipenv and the Pipfile format to manage virtual environments and dependencies.

The project template is populated and then processed by the excellent Cookiecutter Python tool.

Table Of Contents

TL;DR


TL;DR

The objective of this project is to provide a generic machine learning template for python based projects. This includes folder structure, testing and documentation tools integrated with travis and github which should work well for most small to midsize (in terms of number of features & examples) projects using a single instance of a machine.


Todo

  • post hook sphinx-quickstart
  • travis config for docs to gh_pages

Features

  • Testing setup with py.test
  • Travis-CI: Ready for Travis Continuous Integration testing
  • Tox testing: Setup to easily test for Python versions
  • Sphinx docs: Documentation ready for generation with, for example, ReadTheDocs
  • Bumpversion: Pre-configured version bumping with a single command
  • Auto-release to PyPI when you push a new tag to master (optional)
  • Command line interface using Click (optional)

Build Status

Linux:

Linux build status on Travis CI

Windows:

Not supported for now.


Quickstart

Install the latest Cookiecutter if you haven't installed it yet (this requires Cookiecutter 1.4.0 or higher):

pipenv install cookiecutter

Generate a Python package project from this template:

cookiecutter https://github.com/project-delphi/cookiecutter-ml-template.git

Then:

  • Create a repo and put it there.
  • Add the repo to your Travis-CI account.
  • Install the dev requirements using pipenv from an Pipfile. pipenv install
  • Register your project with PyPI.
  • Run the Travis CLI command travis encrypt --add deploy.password to encrypt your PyPI password in Travis config and activate automated deployment on PyPI when you push a new tag to master branch.
  • Add the repo to your ReadTheDocs account + turn on the ReadTheDocs service hook.
  • Release your package by pushing a new tag to master.
  • Add a requirements.txt file that specifies the packages you will need for your project and their versions. For more info see the pip docs for requirements files.
  • Activate your project on pyup.io.

For more details, see the cookiecutter-pypackage tutorial.


Alternatives

Not Exactly What You Want? Don't worry, you have options. You can look at:

  • Similar Projects
    • Other Cookiecutter Templates
    • Non Cookiecutter Package Skeletons
  • Fork this project
  • Submit a Pull Request

Similar Projects

Related Cookiecutter Templates:

Other Project Templates Without Cookiecutter

Also see the network and family tree for this repo. (If you find anything that should be listed here, please add it and send a pull request!)


Fork This / Create Your Own

If you have differences in your preferred setup, I encourage you to fork this to create your own version. Or create your own; it doesn't strictly have to be a fork.


Submit a Pull Request

Pull requests are welcome, if they're small, atomic, and if they make my own packaging experience better.


Feedback

Aside from PR's you can contact me on twitter.


Support The CookieCutter Project

You can take our detailed course that covers all the features of the cookiecutter project, which has the added bonus of funding it:

Creating and Distributing Python Packages

También disponible en español:

Creating and Distributing Python Packages ES


Built With


Credits

This template is heavily based on PyPackage template from @audreyr.

It is also inspired by Data Science template from Driven Data.


License

You can check out the full license here

This project is licensed under the terms of the MIT license.


About

A cookiecutter template for machine learning projects

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published