Skip to content

Commit 1475250

Browse files
committed
freshness update
1 parent b751510 commit 1475250

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

articles/machine-learning/v1/tutorial-train-deploy-notebook.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.topic: tutorial
99
author: sdgilley
1010
ms.author: sgilley
1111
ms.reviewer: sgilley
12-
ms.date: 09/14/2022
12+
ms.date: 04/02/2024
1313
ms.custom: UpdateFrequency5, sdkv1, devx-track-python
1414
#Customer intent: As a professional data scientist, I can build an image classification model with Azure Machine Learning by using Python in a Jupyter Notebook.
1515
---
@@ -18,7 +18,7 @@ ms.custom: UpdateFrequency5, sdkv1, devx-track-python
1818

1919
[!INCLUDE [sdk v1](../includes/machine-learning-sdk-v1.md)]
2020

21-
In this tutorial, you train a machine learning model on remote compute resources. You'll use the training and deployment workflow for Azure Machine Learning in a Python Jupyter Notebook. You can then use the notebook as a template to train your own machine learning model with your own data.
21+
In this tutorial, you train a machine learning model on remote compute resources. You use the training and deployment workflow for Azure Machine Learning in a Python Jupyter Notebook. You can then use the notebook as a template to train your own machine learning model with your own data.
2222

2323
This tutorial trains a simple logistic regression by using the [MNIST](http://yann.lecun.com/exdb/mnist/) dataset and [scikit-learn](https://scikit-learn.org) with Azure Machine Learning. MNIST is a popular dataset consisting of 70,000 grayscale images. Each image is a handwritten digit of 28 x 28 pixels, representing a number from zero to nine. The goal is to create a multi-class classifier to identify the digit a given image represents.
2424

@@ -38,7 +38,7 @@ Learn how to take the following actions:
3838

3939
## Run a notebook from your workspace
4040

41-
Azure Machine Learning includes a cloud notebook server in your workspace for an install-free and pre-configured experience. Use [your own environment](how-to-configure-environment.md) if you prefer to have control over your environment, packages, and dependencies.
41+
Azure Machine Learning includes a cloud notebook server in your workspace for an install-free and preconfigured experience. Use [your own environment](how-to-configure-environment.md) if you prefer to have control over your environment, packages, and dependencies.
4242

4343
## Clone a notebook folder
4444

@@ -70,7 +70,7 @@ You complete the following experiment setup and run steps in Azure Machine Learn
7070

7171
## Install packages
7272

73-
Once the compute instance is running and the kernel appears, add a new code cell to install packages needed for this tutorial.
73+
Once the compute instance is running and the kernel appears, add a new code cell to install packages needed for this tutorial.
7474

7575
1. At the top of the notebook, add a code cell.
7676
:::image type="content" source="media/tutorial-train-deploy-notebook/add-code-cell.png" alt-text="Screenshot of add code cell for notebook.":::
@@ -82,14 +82,14 @@ Once the compute instance is running and the kernel appears, add a new code cell
8282
%pip install scipy==1.5.2
8383
```
8484

85-
You may see a few install warnings. These can safely be ignored.
85+
You may see a few install warnings. These can safely be ignored.
8686

8787
## Run the notebook
8888

8989
This tutorial and accompanying **utils.py** file is also available on [GitHub](https://github.com/Azure/MachineLearningNotebooks/tree/master/tutorials) if you wish to use it on your own [local environment](how-to-configure-environment.md). If you aren't using the compute instance, add `%pip install azureml-sdk[notebooks] azureml-opendatasets matplotlib` to the install above.
9090
9191
> [!Important]
92-
> The rest of this article contains the same content as you see in the notebook.
92+
> The rest of this article contains the same content as you see in the notebook.
9393
>
9494
> Switch to the Jupyter Notebook now if you want to run the code while you read along.
9595
> To run a single code cell in a notebook, click the code cell and hit **Shift+Enter**. Or, run the entire notebook by choosing **Run all** from the top toolbar.
@@ -101,7 +101,7 @@ Before you train a model, you need to understand the data you're using to train
101101
* Download the MNIST dataset
102102
* Display some sample images
103103

104-
You'll use Azure Open Datasets to get the raw MNIST data files. Azure Open Datasets are curated public datasets that you can use to add scenario-specific features to machine learning solutions for better models. Each dataset has a corresponding class, `MNIST` in this case, to retrieve the data in different ways.
104+
You use Azure Open Datasets to get the raw MNIST data files. Azure Open Datasets are curated public datasets that you can use to add scenario-specific features to machine learning solutions for better models. Each dataset has a corresponding class, `MNIST` in this case, to retrieve the data in different ways.
105105

106106

107107
```python
@@ -119,7 +119,7 @@ mnist_file_dataset.download(data_folder, overwrite=True)
119119

120120
Load the compressed files into `numpy` arrays. Then use `matplotlib` to plot 30 random images from the dataset with their labels above them.
121121

122-
Note this step requires a `load_data` function that's included in an `utils.py` file. This file is placed in the same folder as this notebook. The `load_data` function simply parses the compressed files into numpy arrays.
122+
Note this step requires a `load_data` function, included in an `utils.py` file. This file is placed in the same folder as this notebook. The `load_data` function simply parses the compressed files into numpy arrays.
123123

124124

125125
```python
@@ -175,13 +175,13 @@ for i in np.random.permutation(X_train.shape[0])[:sample_size]:
175175
plt.imshow(X_train[i].reshape(28, 28), cmap=plt.cm.Greys)
176176
plt.show()
177177
```
178-
The code above displays a random set of images with their labels, similar to this:
178+
The code displays a random set of images with their labels, similar to this:
179179
180180
:::image type="content" source="media/tutorial-train-deploy-notebook/image-data-with-labels.png" alt-text="Sample images with their labels.":::
181181
182182
## Train model and log metrics with MLflow
183183
184-
You'll train the model using the code below. Note that you are using MLflow autologging to track metrics and log model artifacts.
184+
Train the model using the following code. This code uses MLflow autologging to track metrics and log model artifacts.
185185
186186
You'll be using the [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) classifier from the [SciKit Learn framework](https://scikit-learn.org/) to classify the data.
187187
@@ -220,13 +220,13 @@ with mlflow.start_run() as run:
220220
221221
## View experiment
222222
223-
In the left-hand menu in Azure Machine Learning studio, select __Jobs__ and then select your job (__azure-ml-in10-mins-tutorial__). A job is a grouping of many runs from a specified script or piece of code. Multiple jobs can be grouped together as an experiment.
223+
In the left-hand menu in Azure Machine Learning studio, select __Jobs__ and then select your job (__azure-ml-in10-mins-tutorial__). A job is a grouping of many runs from a specified script or piece of code. Multiple jobs can be grouped together as an experiment.
224224
225-
Information for the run is stored under that job. If the name doesn't exist when you submit a job, if you select your run you will see various tabs containing metrics, logs, explanations, etc.
225+
Information for the run is stored under that job. If the name doesn't exist when you submit a job, if you select your run you'll see various tabs containing metrics, logs, explanations, etc.
226226
227227
## Version control your models with the model registry
228228
229-
You can use model registration to store and version your models in your workspace. Registered models are identified by name and version. Each time you register a model with the same name as an existing one, the registry increments the version. The code below registers and versions the model you trained above. Once you have executed the code cell below you will be able to see the model in the registry by selecting __Models__ in the left-hand menu in Azure Machine Learning studio.
229+
You can use model registration to store and version your models in your workspace. Registered models are identified by name and version. Each time you register a model with the same name as an existing one, the registry increments the version. The code below registers and versions the model you trained above. Once you execute the following code cell, you'll see the model in the registry by selecting __Models__ in the left-hand menu in Azure Machine Learning studio.
230230
231231
```python
232232
# register the model
@@ -236,11 +236,11 @@ model = mlflow.register_model(model_uri, "sklearn_mnist_model")
236236
237237
## Deploy the model for real-time inference
238238
239-
In this section you learn how to deploy a model so that an application can consume (inference) the model over REST.
239+
In this section, learn how to deploy a model so that an application can consume (inference) the model over REST.
240240
241241
### Create deployment configuration
242242
243-
The code cell gets a _curated environment_, which specifies all the dependencies required to host the model (for example, the packages like scikit-learn). Also, you create a _deployment configuration_, which specifies the amount of compute required to host the model. In this case, the compute will have 1CPU and 1GB memory.
243+
The code cell gets a _curated environment_, which specifies all the dependencies required to host the model (for example, the packages like scikit-learn). Also, you create a _deployment configuration_, which specifies the amount of compute required to host the model. In this case, the compute has 1CPU and 1-GB memory.
244244
245245
246246
```python
@@ -271,7 +271,7 @@ aciconfig = AciWebservice.deploy_configuration(
271271
This next code cell deploys the model to Azure Container Instance.
272272
273273
> [!NOTE]
274-
> The deployment takes approximately 3 minutes to complete.**
274+
> The deployment takes approximately 3 minutes to complete. But it might be longer to until it is available for use, perhaps as long as 15 minutes.**
275275
276276
277277
```python
@@ -300,14 +300,14 @@ service = Model.deploy(
300300
service.wait_for_deployment(show_output=True)
301301
```
302302
303-
The scoring script file referenced in the code above can be found in the same folder as this notebook, and has two functions:
303+
The scoring script file referenced in the preceding code can be found in the same folder as this notebook, and has two functions:
304304
305305
1. An `init` function that executes once when the service starts - in this function you normally get the model from the registry and set global variables
306306
1. A `run(data)` function that executes each time a call is made to the service. In this function, you normally format the input data, run a prediction, and output the predicted result.
307307
308308
### View endpoint
309309
310-
Once the model has been successfully deployed, you can view the endpoint by navigating to __Endpoints__ in the left-hand menu in Azure Machine Learning studio. You will be able to see the state of the endpoint (healthy/unhealthy), logs, and consume (how applications can consume the model).
310+
Once the model is successfully deployed, you can view the endpoint by navigating to __Endpoints__ in the left-hand menu in Azure Machine Learning studio. You'll see the state of the endpoint (healthy/unhealthy), logs, and consume (how applications can consume the model).
311311
312312
## Test the model service
313313
@@ -340,7 +340,7 @@ If you're not going to continue to use this model, delete the Model service usin
340340
service.delete()
341341
```
342342
343-
If you want to control cost further, stop the compute instance by selecting the "Stop compute" button next to the **Compute** dropdown. Then start the compute instance again the next time you need it.
343+
If you want to control cost further, stop the compute instance by selecting the "Stop compute" button next to the **Compute** dropdown. Then start the compute instance again the next time you need it.
344344
345345
### Delete everything
346346

0 commit comments

Comments
 (0)