The most important concept in MLEM is MLEM Object. Basically, MLEM is a library to create, manage and use different MLEM Objects, such as models, data and other types.
MLEM Objects are saved as special metafiles in YAML format with the
extension. These may or may not have artifacts (other files or directories)
Typically, if MLEM Object has only one artifact, it will have the same file
.mlem extension, for example
If MLEM Object have multiple artifacts, they will be stored in a directory
with the same name, for example
Saving models to files or loading them back into python objects may seem like a
deceptively simple task at first. For example,
can serialize/deserialize model objects to/from files, or you can use
to serialize NumPy-heavy models more effectively.
However, when MLEM is used to
save python model objects or enrich existing model
files using the import command, it adds its
"special sauce" - all the things needed to reliably recreate this Python object
later are extracted auto-magically and are written to a
file. This additional "metafile" is a yaml representation of the
MLEM Object corresponding to the model Python object. This is
why we refer to this operation as a "codification" of the model, and is a very
powerful concept, underlining a lot of MLEM's abilities.
Here are the key advantages of using MLEM to save your models:
sklearn or any other package)
Here is a breakdown of the data MLEM extracts from models objects:
pandas in this case, with the specific
versions used to train the model
Down the line this metadata enables us to easily and reliably package and serve different model types in various ways using MLEM.
This is extracted by MLEM when we save/import models with MLEM. We don't have to specify any of this ourselves. MLEM inspects the object (even if it's complex) and infers all of this automatically!