Skip to main content

Extend MLflow's functionality

Project description

MLflow Extend

Documentation Status CI codecov Total alerts Language grade: Python version pyversions Code style: black GitHub

Extend MLflow's functionality.

Installation

From PyPI

pip install mlflow-extend

From GitHub (development version)

pip install git+https://github.com/harupy/mlflow-extend.git

Example

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from plotly import graph_objects as go

from mlflow_extend import mlflow

with mlflow.start_run():
    # mlflow native APIs
    mlflow.log_param('param', 0)
    mlflow.log_metric('metric', 1.0)

    ##### new APIs mlflow_extend provides #####

    # flatten dict
    mlflow.log_params_flatten({"a": {"b": 0}})
    mlflow.log_metrics_flatten({"a": {"b": 0.0}})

    # dict
    mlflow.log_dict({'a': 0}, 'dict.json')

    # numpy array
    mlflow.log_numpy(np.array([0]), 'array.npy')

    # pandas dataframe
    mlflow.log_df(pd.DataFrame({'a': [0]}), 'df.csv')

    # matplotlib figure
    fig, ax = plt.subplots()
    ax.plot([0, 1], [0, 1])
    mlflow.log_figure(fig, 'figure.png')

    # plotly figure
    fig = go.Figure(data=[go.Bar(x=[1, 2, 3], y=[1, 3, 2])])
    mlflow.log_figure(fig, 'figure.html')

    # confusion matrix
    mlflow.log_confusion_matrix([[1, 2], [3, 4]])

    # run "mlflow ui" and see the result.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mlflow-extend-0.1.6.tar.gz (11.8 kB view hashes)

Uploaded Source

Built Distribution

mlflow_extend-0.1.6-py3-none-any.whl (15.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page