Tutorial: Get started creating your first ML experiment with the Python SDK
In this tutorial, you complete the end-to-end steps to get started with the Azure Machine Learning Python SDK running in Jupyter notebooks. This tutorial is part one of a two-part tutorial series, and covers Python environment setup and configuration, as well as creating a workspace to manage your experiments and machine learning models. Part two builds on this to train multiple machine learning models and introduce the model management process using both the Azure portal and the SDK.
In this tutorial, you:
- Create an Azure Machine Learning Workspace to use in the next tutorial.
- Clone the tutorials notebook to your folder in the workspace.
- Create a cloud-based Jupyter notebook VM with Azure Machine Learning Python SDK installed and pre-configured.
If you don’t have an Azure subscription, create a free account before you begin. Try the free or paid version of Azure Machine Learning today.
Create a workspace
An Azure Machine Learning workspace is a foundational resource in the cloud that you use to experiment, train, and deploy machine learning models. It ties your Azure subscription and resource group to an easily consumed object in the service.
You create a workspace via the Azure portal, a web-based console for managing your Azure resources.
Sign in to the Azure portal by using the credentials for the Azure subscription you use.
In the upper-left corner of Azure portal, select + Create a resource.
Use the search bar to find Machine Learning service workspace.
Select Machine Learning service workspace.
In the Machine Learning service workspace pane, select Create to begin.
Provide the following information to configure your new workspace:
Field Description Workspace name Enter a unique name that identifies your workspace. In this example, we use docs-ws. Names must be unique across the resource group. Use a name that's easy to recall and to differentiate from workspaces created by others. Subscription Select the Azure subscription that you want to use. Resource group Use an existing resource group in your subscription or enter a name to create a new resource group. A resource group holds related resources for an Azure solution. In this example, we use docs-aml. Location Select the location closest to your users and the data resources to create your workspace.
After you are finished configuring the workspace, select Create.
It can take several minutes to create your workspace in the cloud.
When the process is finished, a deployment success message appears.
To view the new workspace, select Go to resource.
Take note of your workspace and subscription. You'll need these to ensure you create your experiment in the right place.
Clone a notebook folder
This example uses the cloud notebook server in your workspace for an install-free and pre-configured experience. Use your own environment if you prefer to have control over your environment, packages and dependencies.
You complete the following experiment set-up and run steps in the workspace landing page (preview), a consolidated interface that includes machine learning tools to perform data science scenarios for data science practitioners of all skill levels.
Sign in to the workspace landing page.
Select your subscription and the workspace you created.
Select Notebooks and Files on the left.
Open the samples folder.
Select the "..." at the right of the tutorials folder and then select Clone.
There is a folder displayed for each user who accesses the workspace. Select your folder to clone the tutorial folder there.
Under User Files open your folder and then open the cloned tutorials folder.
You can view notebooks in the samples folder but you cannot run a notebook from there. In order to run a notebook, make sure you open the cloned version of the notebook in the User Files section.
Select the tutorial-1st-experiment-sdk-train.ipynb file in your tutorials folder.
On the top bar, select a Notebook VM to use to run the notebook. These VMs are pre-configured with everything you need to run Azure Machine Learning. You can select a VM created by any user of your workspace.
If no VMs are found, select + New VM to create the VM.
When you create a VM, provide a name. The name must be between 2 to 16 characters. Valid characters are letters, digits, and the - character, and must also be unique across your Azure subscription.
Then select Create. It can take approximately 5 minutes to set up your VM.
Once the VM is available it will be displayed in the top toolbar. You can now run the notebook either by using Run all in the toolbar, or by using Shift+Enter in the code cells of the notebook.
In this tutorial, you completed these tasks:
- Created an Azure Machine Learning workspace.
- Created and configured a cloud notebook server in your workspace.
In part two of the tutorial you run the code in
tutorial-1st-experiment-sdk-train.ipynb to train a machine learning model.
If you do not plan on following part 2 of this tutorial or any other tutorials, you should stop the cloud notebook server VM when you are not using it to reduce cost.