Skip to content

How to test Azure AML Widgets

Don Jayamanne edited this page Jul 21, 2021 · 2 revisions
  • Create Azure Compute https://docs.microsoft.com/en-us/azure/machine-learning/quickstart-create-resources
  • Create a new Compute Instance & star this compute instance
  • Keep track of the following information:
    • Subscription Id
    • Resource Name
    • Workspace Name (compute workspace created)
    • Compute Name (compute instance created)
  • Install Python & dependencies (https://docs.microsoft.com/en-us/python/api/overview/azure/ml/install?view=azure-ml-py)
    • Pip install azureml-core azureml-widgets
  • Create a workspace folder as follows
    • code>hello>hello.py
      print("Hello World!")
    • config.json
      {
          "subscription_id": "...",
          "resource_group": "...",
          "workspace_name": "..."
      }
    • sample.ipynb
      from azureml.core import Workspace, Experiment, ScriptRunConfig
      from azureml.widgets import RunDetails
      
      ws = Workspace.from_config()
      experiment = Experiment(workspace=ws, name='day1-experiment-hello')
      
      config = ScriptRunConfig(source_directory='./code/hello', script='hello.py', compute_target='cpucluster')
      
      run = experiment.submit(config)
      RunDetails(run).show()
  • Run the notebook cell, output should be as follows: Widget Output

Notes:

Clone this wiki locally