healthcareai-py icon indicating copy to clipboard operation
healthcareai-py copied to clipboard

Save python & library version metadata w/ pickled model

Open Aylr opened this issue 7 years ago • 2 comments

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:

  • The python version
  • The version of healthcare.ai
  • The versions of all installed libraries (think pip freeze here)

Implementation Notes

  • This file should have the same filename (except extension) as the saved model.

Aylr avatar Jul 03 '17 19:07 Aylr

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

Aylr avatar Jan 26 '18 13:01 Aylr

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

Aylr avatar Mar 05 '18 21:03 Aylr