Extend MLflow's functionality
Project description
MLflow Extend
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
Examples
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
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')
# confusion matrix
mlflow.log_confusion_matrix([[1, 2], [3, 4]])
Creating Environment
conda create -n mlflow-extend python=3.6
conda activate mlflow-extend
pip install -r requirements.txt -r requirements-dev.txt
Running Lint Check
# Run lint checking with black, isort, and flake8.
./dev/lint.sh
Running Type Check
mypy .
Running Test
# Run all the tests.
./dev/test.sh
# Save figures generated during the tests in '.pytest_basetemp'.
./dev/test.sh --savefig
Building Documentation
cd docs
make html
# Remove everything under 'docs/build' and run 'make html'.
make clean html
The generated files will be stored in docs/build/html
. Open docs/build/html/index.html
on the browser to check if the documentation is built properly.
Releasing New Version
- Make a pull request to update
__version__
inmlflow-extend/version.py
to the next version.
- __version__ = "1.2.2" # current version
+ __version__ = "1.2.3" # next version
- After the pull request is merged, create a new tag and push it to the remote.
git tag v1.2.3
git push origin v1.2.3
-
Open the release page and create a new release.
-
Upload distribution archives to PyPI using twine.
# Remove old distribution archives.
rm -r dist/*
# Generate new distribution archives.
python setup.py sdist bdist_wheel
# Upload to Test PyPI and verify everything looks right.
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
# Upload to PyPI (THIS CAN NOT BE UNDONE).
twine upload dist/*
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.3.tar.gz
(7.4 kB
view details)
Built Distribution
File details
Details for the file mlflow-extend-0.1.3.tar.gz
.
File metadata
- Download URL: mlflow-extend-0.1.3.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3385542ef276c123d46f058d690a9fe0656b68808abb0ef8863de725cc5607eb |
|
MD5 | d47340d00dda5f10bfa96abf82c373c3 |
|
BLAKE2b-256 | afbbc6755f96b8c5be8ff86c1608cea0a1ebacf0120e2246cd78d57357f9c34d |
File details
Details for the file mlflow_extend-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: mlflow_extend-0.1.3-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d49c24c65f94ee5b6585f9542478cf8324a0da37cd0802bb5001d6c0f9933a0 |
|
MD5 | d39b25466aa32ee006eb5d0fe1ff657a |
|
BLAKE2b-256 | c7f7e1fce4dbed9adf5aa2e6c0d8d9f1f34608fb35a4a11e139299d28073d0c4 |