Skip to content

Simplify methods #57

@characat0

Description

@characat0

Right now most of the methods expect to receive instances of MLFlow, MLFlowExperiment and/or MLFlowRunInfo.
This makes calls unnecessarily verbose, as opposed to the python client, that manages a global state.

From our docs

using MLFlowClient

# Create MLFlow instance
mlf = MLFlow("http://localhost:5000/api")

# Initiate new experiment
experiment_id = createexperiment(mlf; name="price-paths")
exprun = createrun(mlf, experiment_id)

logmetric(mlf, exprun, "pricepath", pricepath)

From the MLflow Tracking QuickStart Guide

import mlflow

# Set our tracking server uri for logging
mlflow.set_tracking_uri(uri="http://127.0.0.1:8080")

# Create a new MLflow Experiment
mlflow.set_experiment("MLflow Quickstart")

# Start an MLflow run
with mlflow.start_run():
    # Log the hyperparameters
    mlflow.log_params(params)

    # Log the loss metric
    mlflow.log_metric("accuracy", accuracy)

The Python API is more concise, and the context manager also takes care of finishing the run even if the code inside fails.
If its something desirable, I can start working on adding extra methods for simplifying our API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requestedwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions