HealthCatalyst / healthcareai-py

Python tools for healthcare machine learning
http://healthcare.ai
MIT License
315 stars 188 forks source link

Save python & library version metadata w/ pickled model #304

Open Aylr opened 7 years ago

Aylr commented 7 years ago

Background

Pickling is dangerous because it assumes the exact environment when objects are deserialized from disk.

A real solution would be to save a model in an environmental agnostic way, such as JSON. This is nontrivial to do. Therefore, MVP first:

MVP

When a model is saved (as a pickled TrainedSupervisedModel), also save a .json (preferable) or .txt file describing the following:

Implementation Notes

Aylr commented 6 years ago

This finally struck and caused me to lose 2-3 hours on client work.

Aylr commented 6 years ago

This is a small amount of work and the output from pip freeze and python --version should easily suffice.