Export Training Facts

Important

  • Following export_payload utility to be used in cases when user needs something additional logged under any given training run. After autolog is done sending results to factsheet, user can use (see Trace and Customize Training Runs) utilities to add new metrics, params and tags as applicable to any given training run and export updated results to factsheet.

  • It is subject to local storage which facts client uses as an intermediary step. In case when using Watson Studio notebook environment, reloading notebooks sessions might cause exceptions to local storage thus these utilities will not function as expected. In cases like that, users are expected to reinitiate facts client using same experiment name, re-run training cells, update any results needed and export to factsheet.

  • To associate exported payload with Watson Machine learning model, custom meta attributes need to be set invoking prepare_model_meta().

AutoLog-Enabled Client

class ExportFacts(facts_service_client: FactsClientAdapter, **kwargs)

Bases: FactsheetServiceClientAutolog

Export updated payloads for any run

export_payload(run_id: str, root_directory: str = None) DetailedResponse

Export single run to factsheet service.

Parameters:
  • run_id (str) – Id of run to be exported

  • root_directory (str) – (Optional) Absolute path for directory containing experiments and runs.

Returns:

A DetailedResponse containing the factsheet response result

Return type:

DetailedResponse

A way you might use me is:

>>> client.export_facts.export_payload(<RUN_ID>)
prepare_model_meta(wml_client: object, meta_props: Dict[str, Any], experiment_name: str = None) Dict

Add current experiment attributes to model meta properties

Parameters:
  • wml_client (object) – Watson Machine learning client object.

  • meta_props (dict) – Current model meta properties.

  • experiment_name (str) – (Optional) Explicit name any experiment to be used.

Returns:

A Dict containing the updated meta properties.

Return type:

Dict

A way you might use me is:

>>> client.export_facts.prepare_model_meta(wml_client=<wml_client>,meta_props=<wml_model_meta_props>)

ManualLog-Enabled Client

class ExportFactsManual(facts_service_client: FactsClientAdapter, **kwargs)

Bases: FactsheetServiceClientManual

Export payloads for any run tracked by manual log

export_payload_manual(run_id: str, root_directory: str = None) DetailedResponse

Export single run to factsheet when using manual logging option. Use this option when client is initiated with enable_autolog=False and external_model=True

Parameters:
  • run_id (str) – Id of run to be exported

  • root_directory (str) – (Optional) Absolute path for directory containing experiments and runs.

Returns:

A DetailedResponse containing the factsheet response result

Return type:

DetailedResponse

A way you might use me is:

>>> client.export_facts.export_payload_manual(<RUN_ID>)
prepare_model_meta(wml_client: object, meta_props: Dict[str, Any], experiment_name: str = None) Dict

Add current experiment attributes to model meta properties

Parameters:
  • wml_client (object) – Watson Machine learning client object.

  • meta_props (dict) – Current model meta properties.

  • experiment_name (str) – (Optional) Explicit name any experiment to be used.

Returns:

A Dict containing the updated meta properties.

Return type:

Dict

A way you might use me is:

>>> client.export_facts.prepare_model_meta(wml_client=<wml_client>,meta_props=<wml_model_meta_props>)