You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#Customer intent: As a data scientist, I want to understand the big picture about how Azure Machine Learning works.
15
15
---
16
16
@@ -34,23 +34,57 @@ Azure Machine Learning includes several resources and assets to enable you to pe
34
34
35
35
This document provides a quick overview of these resources and assets.
36
36
37
-
## Workspace
37
+
## Prerequisites
38
38
39
-
The workspace is the top-level resource for Azure Machine Learning, providing a centralized place to work with all the artifacts you create when you use Azure Machine Learning. The workspace keeps a history of all jobs, including logs, metrics, output, and a snapshot of your scripts. The workspace stores references to resources like datastores and compute. It also holds all assets like models, environments, components and data asset.
39
+
### [Python SDK](#tab/sdk)
40
40
41
-
### Create a workspace
41
+
To use the Python SDK code examples in this article:
42
+
43
+
1. Install the [Python SDK v2](https://aka.ms/sdk-v2-install)
44
+
2. Create a connection to your Azure Machine Learning subscription. The examples all rely on `ml_client`. To create a workspace, the connection does not need a workspace name, since you may not yet have one. All other examples in this article require that the workspace name is included in the connection.
45
+
46
+
```python
47
+
# import required libraries
48
+
from azure.ai.ml import MLClient
49
+
from azure.ai.ml.entities import Workspace
50
+
from azure.identity import DefaultAzureCredential
51
+
52
+
# Enter details of your subscription
53
+
subscription_id ="<SUBSCRIPTION_ID>"
54
+
resource_group ="<RESOURCE_GROUP>"
55
+
56
+
# get a handle to the subscription (use this if you haven't created a workspace yet)
To create a workspace using CLI v2, use the following command:
66
+
To use the Azure CLIcode examples in this article, you need to have the Azure CLI installed and configured. You can install the Azure CLIfrom the [Install andset up the CLI (v2)](how-to-configure-cli.md).
For more information, see [workspace YAML schema](reference-yaml-workspace.md).
77
+
### [Studio](#tab/azure-studio)
78
+
79
+
Sign in to [Azure Machine Learning studio](https://ml.azure.com).
80
+
81
+
---
82
+
83
+
## Workspace
84
+
85
+
The workspace is the top-level resource for Azure Machine Learning, providing a centralized place to work withall the artifacts you create when you use Azure Machine Learning. The workspace keeps a history of all jobs, including logs, metrics, output, and a snapshot of your scripts. The workspace stores references to resources like datastores and compute. It also holds all assets like models, environments, components and data asset.
86
+
87
+
### Create a workspace
54
88
55
89
### [Python SDK](#tab/sdk)
56
90
@@ -59,48 +93,53 @@ To create a workspace using Python SDK v2, you can use the following code:
location="eastus", # Azure region (location) of workspace
65
-
display_name="Basic workspace-example",
66
-
description="This example shows how to create a basic workspace"
96
+
# specify the workspace details
97
+
ws = Workspace(
98
+
name="my_workspace",
99
+
location="eastus",
100
+
display_name="My workspace",
101
+
description="This example shows how to create a workspace",
102
+
tags=dict(purpose="demo"),
67
103
)
68
-
ml_client.workspaces.begin_create(ws_basic) # use MLClient to connect to the subscription and resource group and create workspace
104
+
105
+
ml_client.workspaces.begin_create(ws) # use MLClient to connect to the subscription and resource group and create workspace
69
106
```
70
107
71
108
This [Jupyter notebook](https://github.com/Azure/azureml-examples/blob/main/sdk/python/resources/workspace/workspace.ipynb) shows more ways to create an Azure Machine Learning workspace using SDK v2.
72
109
73
-
---
74
-
75
-
## Compute
110
+
### [Azure CLI](#tab/cli)
76
111
77
-
A compute is a designated compute resource where you run your job or host your endpoint. Azure Machine Learning supports the following types of compute:
112
+
To create a workspace using CLI v2, use the following command:
78
113
79
-
***Compute cluster** - a managed-compute infrastructure that allows you to easily create a cluster of CPU or GPU compute nodes in the cloud.
***Compute instance** - a fully configured and managed development environment in the cloud. You can use the instance as a training or inference compute for development and testing. It's similar to a virtual machine on the cloud.
84
-
***Inference cluster** - used to deploy trained machine learning models to Azure Kubernetes Service. You can create an Azure Kubernetes Service (AKS) cluster from your Azure Machine Learning workspace, or attach an existing AKS cluster.
85
-
***Attached compute** - You can attach your own compute resources to your workspace and use them for training and inference.
120
+
For the content of the file, see [workspace YAML examples](https://github.com/Azure/azureml-examples/tree/main/cli/resources/workspace).
86
121
122
+
### [Studio](#tab/azure-studio)
87
123
88
-
### [Azure CLI](#tab/cli)
124
+
Create a workspace in the studio welcome page by selecting **Create workspace**.
89
125
90
-
To create a compute using CLI v2, use the following command:
A compute is a designated compute resource where you run your job or host your endpoint. Azure Machine Learning supports the following types of compute:
97
131
98
-
For more information, see [compute YAML schema](reference-yaml-overview.md#compute).
132
+
***Compute instance**- a fully configured and managed development environment in the cloud. You can use the instance as a training or inference compute for development and testing. It's similar to a virtual machine on the cloud.
133
+
***Compute cluster**- a managed-compute infrastructure that allows you to easily create a cluster of CPUorGPU compute nodes in the cloud.
134
+
***Serverless compute**- a compute cluster you access on the fly. When you use serverless compute, you don't need to create your own cluster. All compute lifecycle management is offloaded to Azure Machine Learning.
135
+
***Inference cluster**- used to deploy trained machine learning models to Azure Kubernetes Service. You can create an Azure Kubernetes Service (AKS) cluster from your Azure Machine Learning workspace, or attach an existing AKS cluster.
136
+
***Attached compute**- You can attach your own compute resources to your workspace and use them for training and inference.
99
137
138
+
### Create a compute
100
139
101
140
### [Python SDK](#tab/sdk)
102
141
103
-
To create a compute using Python SDK v2, you can use the following code:
142
+
To create a compute cluster using Python SDK v2, you can use the following code:
This [Jupyter notebook](https://github.com/Azure/azureml-examples/blob/main/sdk/python/resources/compute/compute.ipynb) shows more ways to create compute using SDK v2.
121
160
161
+
### [Azure CLI](#tab/cli)
162
+
163
+
To create a compute using CLI v2, use the following command:
This [Jupyter notebook](https://github.com/Azure/azureml-examples/blob/main/sdk/python/resources/datastores/datastore.ipynb) shows more ways to create datastores using SDK v2.
165
216
166
-
---
167
-
168
-
## Model
169
-
170
-
Azure machine learning models consist of the binary file(s) that represent a machine learning model and any corresponding metadata. Models can be created from a local or remote file or directory. For remote locations `https`, `wasbs` and `azureml` locations are supported. The created model will be tracked in the workspace under the specified name and version. Azure Machine Learning supports three types of storage format for models:
171
-
172
-
*`custom_model`
173
-
*`mlflow_model`
174
-
*`triton_model`
175
-
176
-
### Creating a model
177
-
178
217
### [Azure CLI](#tab/cli)
179
218
180
-
To create a model using CLI v2, use the following command:
219
+
To create a datastore using CLI v2, use the following command:
path="model.pkl", # the path to where my model file is located
200
-
type="custom_model", # can be custom_model, mlflow_model or triton_model
201
-
name="my-model",
202
-
description="Model created from local file.",
203
-
)
240
+
Azure Machine Learning models consist of the binary file(s) that represent a machine learning model and any corresponding metadata. Models can be created from a local or remote file or directory. For remote locations `https`, `wasbs` and `azureml` locations are supported. The created model will be tracked in the workspace under the specified name and version. Azure Machine Learning supports three types of storage format for models:
204
241
205
-
ml_client.models.create_or_update(my_model) # use the MLClient to connect to workspace and create/register the model
206
-
```
242
+
*`custom_model`
243
+
*`mlflow_model`
244
+
*`triton_model`
207
245
208
-
---
246
+
### Create a model in the model registry
247
+
248
+
Model registration allows you to store and version your models in the Azure cloud, in your workspace. The model registry helps you organize and keep track of your trained models.
249
+
250
+
For more information on how to create models in the registry, see [Work with models in Azure Machine Learning](how-to-manage-models.md).
209
251
210
252
## Environment
211
253
@@ -225,36 +267,25 @@ In custom environments, you're responsible for setting up your environment and i
225
267
226
268
### Create an Azure Machine Learning custom environment
227
269
228
-
### [Azure CLI](#tab/cli)
229
-
230
-
To create an environment using CLI v2, use the following command:
az ml environment create --file my_environment.yml
236
-
```
237
-
For more information, see [environment YAML schema](reference-yaml-environment.md).
238
270
271
+
### [Python SDK](#tab/sdk)
239
272
273
+
To create an environment using Python SDK v2, see [Create an environment](how-to-manage-environments-v2.md?tabs=python#create-an-environment).
240
274
241
-
### [Python SDK](#tab/sdk)
275
+
This [Jupyter notebook](https://github.com/Azure/azureml-examples/blob/main/sdk/python/assets/environment/environment.ipynb) shows more ways to create custom environments using SDK v2.
242
276
243
-
To create an environment using Python SDK v2, you can use the following code:
To create an environment using CLI v2, see [Create an environment](how-to-manage-environments-v2.md?tabs=cli#create-an-environment).
246
280
247
-
```python
248
-
my_env = Environment(
249
-
image="pytorch/pytorch:latest", # base image to use
250
-
name="docker-image-example", # name of the model
251
-
description="Environment created from a Docker image.",
252
-
)
281
+
For more information, see [environment YAML schema](reference-yaml-environment.md).
253
282
254
-
ml_client.environments.create_or_update(my_env) # use the MLClient to connect to workspace and create/register the environment
255
-
```
283
+
### [Studio](#tab/azure-studio)
256
284
257
-
This [Jupyter notebook](https://github.com/Azure/azureml-examples/blob/main/sdk/python/assets/environment/environment.ipynb) shows more ways to create custom environments using SDK v2.
285
+
1. Select a workspace if you are not already in one.
286
+
1. From the left-hand menu, select **Environments**.
287
+
1. On the top, select **Custom environments**.
288
+
1. Select **Create** to create a new custom environment.
0 commit comments