create_aml_run_object

health_azure.create_aml_run_object(experiment_name, run_name=None, workspace=None, workspace_config_path=None, snapshot_directory=None)[source]

Creates an AzureML Run object in the given workspace, or in the workspace given by the AzureML config file. This Run object can be used to write metrics to AzureML, upload files, etc, when the code is not running in AzureML. After finishing all operations, use run.flush() to write metrics to the cloud, and run.complete() or run.fail().

Example: >>>run = create_aml_run_object(experiment_name=”run_on_my_vm”, run_name=”try1”) >>>run.log(“foo”, 1.23) >>>run.flush() >>>run.complete()

Parameters
  • experiment_name (str) – The AzureML experiment that should hold the run that will be created.

  • run_name (Optional[str]) – An optional name for the run (this will be used as the display name in the AzureML UI)

  • workspace (Optional[Workspace]) – If provided, use this workspace to create the run in. If not provided, use the workspace specified by the config.json file in the folder or its parent folder(s).

  • workspace_config_path (Optional[Path]) – If not provided with an AzureML workspace, then load one given the information in this config file.

  • snapshot_directory (Union[Path, str, None]) – The folder that should be included as the code snapshot. By default, no snapshot is created (snapshot_directory=None or snapshot_directory=””). Set this to the folder that contains all the code your experiment uses. You can use a file .amlignore to skip specific files or folders, akin to .gitignore

Return type

Run

Returns

An AzureML Run object.