Machine Learning model utils functions.
To install the dependencies listed in requirements/base.txt, you can use:
$ pip install -r requirements/base.txt
To install ML Model Utils, run this command in your terminal:
$ pip install ml_model_utils
This is the preferred method to install ML Model Utils, as it will always install the most recent stable release.
The sources for ML Model Utils can be downloaded from the Github repo.
You can either clone the public repository:
$ git clone https://github.com/zhiwei2017/ml_model_utils.git
Once you have a copy of the source, you can install it with:
$ python setup.py install
or
$ pip install .
Here is an example for using ml_model_utils to upload model and its metrics to mlflow:
from ml_model_utils.mlflow import upload_model from ml_model_utils.constants import MlflowModelStage upload_model("https://mlflow.dummy.com", "dummy-model", "dummy_model", "classifier", model, dict(precision=0.91, recall=0.90, f1_score=0.905, support=300), MlflowModelStage.STAGING, MlflowModelStage.ARCHIVED)
Here is an example for gettting files from a given S3 path:
from ml_model_utils.files import get_s3_files get_s3_files("s3://dummy_bucket/dummy/path")
For more usages, please check the section Source from our documentation.
- Zhiwei Zhang - Maintainer - [email protected]