NotebookRunConfig 类

设置笔记本运行配置。

继承
NotebookRunConfig

构造函数

NotebookRunConfig(source_directory, notebook, output_notebook=None, parameters=None, handler=None, run_config=None, _telemetry_values=None)

参数

source_directory
str
必需

源目录。

notebook
str
必需

笔记本文件名。

output_notebook
str
默认值: None

输出笔记本文件名。

parameters
dict
默认值: None

笔记本参数的字典。

handler
NotebookExecutionHandler
默认值: None

NotebookExecutionHandler 的实例。

run_config
RunConfiguration
默认值: None
_telemetry_values
dict
默认值: None

仅限内部使用。

注解


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

   # Create new experiment
   workspace = Workspace.from_config()
   exp = Experiment(workspace, "simple_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

   # Create notebook run configuration and set parameters values
   cfg = NotebookRunConfig(source_directory="./notebooks",
                           notebook="notebook-sample.ipynb",
                           parameters={"arg1": "Machine Learning"},
                           run_config=run_config_user_managed)

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