Skip to main content

git + logging for ML

Project description

chart

Dependencies Travis PyPI Downloads

About

mummify makes model prototyping faster. The package automagically takes care of git and logging for your machine learning project so that you can focus on what's important.

Functions

mummify is one function and two command line tools:

  • log - to automatically log and commit model changes
  • mummify history - to view those changes
  • mummify switch - to go back to a different version of your model

Usage

mummify is simple to use. Just add import mummify at the top and mummify.log(<string>) at the bottom of your model:

import mummify

from sklearn.datasets import load_wine
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier

data = load_wine()
y = data.target
X = data.data

X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.2, random_state=42)

model = KNeighborsClassifier()
model.fit(X_train, y_train)
accuracy = model.score(X_test, y_test)

mummify.log(f'Test accuracy: {accuracy:.3f}')

When you run your model (python model.py) for the first time mummify will create a protected .mummify git folder and will start to log messages to a mummify.log file.

When you make changes and run everything again:

...
model = LogisticRegression()
model.fit(X_train, y_train)
accuracy = model.score(X_test, y_test)

mummify.log(f'Test accuracy: {accuracy:.3f}')

mummify will update the mummify.log file and save a snapshot of your working directory.

To view the history of your model, just run mummify history from the command line:

max$ mummify history

*  HEAD mummify-3d15c7c2
*  mummify-2d234a8a
*  mummify-1fad5388
*  mummify-root

And to go back to a previous snapshot of your model just grab the mummify id from the mummify.log file and run mummify switch <id> from the command line:

max$ mummify switch mummify-2d234a8a

mummify will preserve all state history during and after a switch and keep the mummify.log file intact.

Installation

pip install mummify

Contribute

For feature requests or bug reports, please use Github Issues

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mummify, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size mummify-1.0.2.tar.gz (4.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page