mlsync.producers.mlflow package
Submodules
mlsync.producers.mlflow.mlflow_api module
- class mlsync.producers.mlflow.mlflow_api.MLFlowAPI(mlflowRoot)
Bases:
object
API to interact with MLFlow
- getExperiment(experiment_id)
Get the experiment with the given id
- Parameters
experiment_id (str) – experiment id
- getExperimentRuns(experiment_id, filter_string=None, max_results=50000, order_by=None, page_token=None)
Get the runs with the given experiment id and other filters
- Parameters
experiment_id (str) – experiment id
filter_string (str) – filter string for the query
max_results (int) – max number of results to return
order_by (str) – order by field
page_token (str) – page token
- getExperiments()
Get all the experiments
- getRunMetric(run_id, metric_key)
Get the experiment with the given id
- Parameters
run_id (str) – run id, unique for each run
metric_key (str) – metric key to get. For example, accuracy
- startServer()
Wait until the MLFlow server is up
- testUpStatus()
Test the status of the MLFlow server
mlsync.producers.mlflow.mlflow_formatter module
- class mlsync.producers.mlflow.mlflow_formatter.MLFlowFormatter(report_format: dict, mlflow_api: MLFlowAPI)
Bases:
object
Creates the report format for MLFlow Runs.
- Parameters
report_format (dict) – The report format to be used.
mlflow_api (MLFlowAPI) – The MLFlow API object.
- add_alias_table()
Add the alias table to the report
- augment_report_format(report_format)
This function will augment over the user provided report format.
Specifically, it will add the following fields:
- For experiment:
key: Unique identifier for the experiment
values: A dictionary of values to be added to the report
- For run:
key: Unique identifier for the run
values: A dictionary of values (provided by the user) to be added to the report
- Parameters
report_format (dict) – Report format dict.
- format_in(experiments: dict, runs: dict, detailed_metrics: bool) dict
Convert the MLFlow report to the report format.
- Parameters
mlflow_report (dict) – The MLFlow report.
- Returns
The report format and the state of the report.
- Return type
(dict, dict)
- format_out()
Convert the report format to the MLFlow report.
- generate_experiment(experiments)
Retain the experiment information
- Parameters
experiments (dict) – The experiment information from MLFlow
experiment_report_format (dict) – The experiment report format
- generate_run(runs, detailed_metrics)
Generate the run report
- Parameters
reports_run (list) – The list of run information from MLFlow
run_report_format (dict) – The run report format
- generate_run_metrics(report_metric)
Generate the run metrics
- Parameters
report_metric (dict) – The metric information from MLFlow