eqdisco.mlops.ModelRegistry#

class eqdisco.mlops.ModelRegistry(root)[source]#

Bases: object

File-based registry of versioned equations.

Layout: <root>/<name>/v<k>.json (the equation and its record) and <root>/<name>/index.json.

Examples

>>> import tempfile, numpy as np
>>> from eqdisco import Equation
>>> from eqdisco.mlops import ModelRegistry
>>> reg = ModelRegistry(tempfile.mkdtemp())
>>> eq = Equation.from_string("2*x0 + 1")
>>> reg.register("demo", eq, metrics={"r2": 0.99})
1
>>> reg.promote("demo", 1, "production")
>>> print(reg.load("demo", stage="production"))
2 * x0 + 1
compare(name, v1, v2)[source]#

Structural and parametric comparison of two versions.

list(name=None)[source]#

Table of the versions of one model (or of all models).

load(name, version='latest', stage=None)[source]#

Load a version, or the newest version in stage.

promote(name, version, stage='production')[source]#

Move a version to stage; the previous production version is archived.

record(name, version='latest')[source]#

The stored record of a version ("latest" or a number).

register(name, equation, metrics=None, X=None, y=None, tags=None, description='', card=None)[source]#

Store a new version; returns its number.

Examples using eqdisco.mlops.ModelRegistry#

Registry, model card and drift monitoring

Registry, model card and drift monitoring