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.

Source Distribution

mummify-1.1.0.tar.gz (4.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page