whylogs.mlflow

Package Contents

Functions

disable_mlflow()

enable_mlflow() → bool

Enable whylogs in mlflow module via mlflow.whylogs.

list_whylogs_runs(experiment_id: str, dataset_name: str = 'default')

List all the runs from an experiment that contains whylogs

get_run_profiles(run_id: str, dataset_name: str = 'default', client=None)

Retrieve all whylogs DatasetProfile for a given run and a given dataset name.

get_experiment_profiles(experiment_id: str, dataset_name: str = 'default')

Retrieve all whylogs profiles for a given experiment. This only

whylogs.mlflow.disable_mlflow()
whylogs.mlflow.enable_mlflow()bool

Enable whylogs in mlflow module via mlflow.whylogs.

Returns

True if MLFlow has been patched. False otherwise.

Example of whylogs and MLFlow
import mlflow
import whylogs

whylogs.enable_mlflow()

import numpy as np
import pandas as pd
pdf = pd.DataFrame(
    data=[[1, 2, 3, 4, True, "x", bytes([1])]],
    columns=["b", "d", "a", "c", "e", "g", "f"],
    dtype=np.object,
)

active_run = mlflow.start_run()

# log a Pandas dataframe under default name
mlflow.whylogs.log_pandas(pdf)

# log a Pandas dataframe with custom name
mlflow.whylogs.log_pandas(pdf, "another dataset")

# Finish the MLFlow run
mlflow.end_run()
whylogs.mlflow.list_whylogs_runs(experiment_id: str, dataset_name: str = 'default')

List all the runs from an experiment that contains whylogs

Return type

typing.List[mlflow.entities.Run]

Parameters
  • experiment_id – the experiment id

  • dataset_name – the name of the dataset. Default to “default”

whylogs.mlflow.get_run_profiles(run_id: str, dataset_name: str = 'default', client=None)

Retrieve all whylogs DatasetProfile for a given run and a given dataset name.

Parameters
  • clientmlflow.tracking.MlflowClient

  • run_id – the run id

  • dataset_name – the dataset name within a run. If not set, use the default value “default”

Return type

typing.List[whylogs.DatasetProfile]

whylogs.mlflow.get_experiment_profiles(experiment_id: str, dataset_name: str = 'default')

Retrieve all whylogs profiles for a given experiment. This only returns Active Runs at the moment.

Return type

typing.List[whylogs.DatasetProfile]

Parameters
  • experiment_id – the experiment ID string

  • dataset_name – the dataset name within a run. If not set, use the default value “default”