AzureMLNotebookHandler 类

表示基于 Papermill 的笔记本执行处理程序。

Papermill 是一种用于参数化和执行 Jupyter 笔记本的工具。

继承
azureml.contrib.notebook._notebook_handler.NotebookExecutionHandler
AzureMLNotebookHandler

构造函数

AzureMLNotebookHandler(history=True, timeout=None, **kwargs)

参数

history
bool
默认值: True

是否启用指标日志以运行历史记录。 默认值为 True。

timeout
int
默认值: None

单元执行超时(以秒为单位)。

kwargs
dict
必需

可选参数的字典。 请参阅 supported_options

注解


   # Import dependencies
   from azureml.core import Workspace, Experiment, RunConfiguration
   from azureml.contrib.notebook import NotebookRunConfig, AzureMLNotebookHandler

   # Create new experiment
   workspace = Workspace.from_config()
   exp = Experiment(workspace, "azureml_notebook_experiment")

   # Customize run configuration to execute in user managed environment
   run_config_user_managed = RunConfiguration()
   run_config_user_managed.environment.python.user_managed_dependencies = True

   # Instante AzureML notebook handler with cell execution timeout
   handler = AzureMLNotebookHandler(timeout=600, progress_bar=False)

   # Create notebook run configuration
   cfg = NotebookRunConfig(source_directory="./notebooks",
                           notebook="notebook-sample.ipynb",
                           handler=handler,
                           run_config=run_config_user_managed)

   # Submit experiment and wait for completion
   run = exp.submit(cfg)
   run.wait_for_completion(show_output=True)

属性

supported_options

supported_options = ['progress_bar', 'log_output', 'kernel_name', 'cwd']