Skip to content

Blog#

Upstreaming experimental results

With MLtraq, upstreaming results is as easy as persisting the experiment to a new session. You can use any SQL database supported by SQLAlchemy. No need to add more complexity with more dedicated running services.

Upstreaming experiments

from mltraq import create_session
from mltraq.utils.fs import tmpdir_ctx

with tmpdir_ctx():

    # Creating a session to a local MLtraq db
    local = create_session("sqlite:///local.db")

    # Working on a new experiment ...
    local.create_experiment("iris").persist()

    # Upstreaming results to a (simulated) remote db ...
    remote = create_session("sqlite:///remote.db")
    remote.persist_experiment(
        local.load_experiment("iris"), if_exists="replace"
    )
Output