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
@@ -38,7 +39,6 @@ You can run this code in either an Azure Machine Learning compute instance, or y
38
39
39
40
- Create a Jupyter notebook server and run the code in the following sections.
40
41
-[Install the Azure Machine Learning SDK (v2)](https://aka.ms/sdk-v2-install).
41
-
-[Create a workspace configuration file](how-to-configure-environment.md#workspace).
42
42
43
43
44
44
## Set up the experiment
@@ -47,12 +47,11 @@ This section sets up the training experiment by loading the required Python pack
47
47
48
48
### Connect to the workspace
49
49
50
-
First, you'll need to connect to your Azure Machine Learning workspace. The [AzureML workspace](concept-workspace.md) is the top-level resource for the service. It provides you with a centralized place to work with all the artifacts you create when you use Azure Machine Learning.
50
+
First, you'll need to connect to your AzureML workspace. The [AzureML workspace](concept-workspace.md) is the top-level resource for the service. It provides you with a centralized place to work with all the artifacts you create when you use Azure Machine Learning.
51
51
52
52
We're using `DefaultAzureCredential` to get access to the workspace. This credential should be capable of handling most Azure SDK authentication scenarios.
53
53
54
-
<!-- M.A: link to "configure credential example" is missing (broken in notebook) -->
55
-
If `DefaultAzureCredential` credential does not work for you, see [`azure-identity reference documentation`](/python/api/azure-identity/azure.identity?view=azure-python) or [`Set up authentication`](/azure/machine-learning/how-to-setup-authentication?tabs=sdk) for more available credentials.
54
+
If `DefaultAzureCredential` credential does not work for you, see [`azure-identity reference documentation`](/python/api/azure-identity/azure.identity) or [`Set up authentication`](how-to-setup-authentication.md?tabs=sdk) for more available credentials.
@@ -121,13 +120,13 @@ In this section, we'll cover how to run a training job, using a training script
121
120
122
121
### Prepare the training script
123
122
124
-
In this article, we've provided the [training script **train_iris.py**](https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/ml-frameworks/scikit-learn/train-hyperparameter-tune-deploy-with-sklearn/train_iris.py) for you. In practice, you should be able to take any custom training script as is and run it with AzureML without having to modify your code.
123
+
In this article, we've provided the training script *train_iris.py* to you. In practice, you should be able to take any custom training script as is and run it with AzureML without having to modify your code.
125
124
126
125
Notes:
127
126
128
127
The provided training script does the following:
129
128
- shows how to log some metrics to your AzureML run;
130
-
- downloads and extracts the training data using the `iris = datasets.load_iris()` function; and
129
+
- downloads and extracts the training data using the `iris = datasets.load_iris()` function; and
131
130
- trains a model, then saves and registers it.
132
131
133
132
To use and access your own data, see [how to train with datasets](v1/how-to-train-with-datasets.md) to make data available during training.
@@ -186,7 +185,7 @@ As the job is executed, it goes through the following stages:
186
185
187
186
## Tune model hyperparameters
188
187
189
-
Now that we've seen how to do a simple Scikit-learn training run using the SDK, let's see if we can further improve the accuracy of our model. We can optimize our model's hyperparameters using Azure Machine Learning's [`sweep`](python/api/azure-ai-ml/azure.ai.ml.sweep?view=azure-python-preview) capabilities.
188
+
Now that we've seen how to do a simple Scikit-learn training run using the SDK, let's see if we can further improve the accuracy of our model. We can optimize our model's hyperparameters using Azure Machine Learning's [`sweep`](/python/api/azure-ai-ml/azure.ai.ml.sweep) capabilities.
190
189
191
190
To tune the model's hyperparameters, you'll define the parameter space in which to search during training. You'll do this by replacing some of the parameters (`kernel` and `penalty`) passed to the training job with special inputs from the `azure.ml.sweep` package.
192
191
@@ -215,59 +214,15 @@ You can now register this model.
you've trained the model, you can save and register it to your workspace. Model registration lets you store and version your models in your workspace to simplify [model management and deployment](concept-model-management-and-deployment.md).
221
-
222
-
Add the following code to your training script, train_iris.py, to save the model.
223
-
224
-
``` Python
225
-
import joblib
226
-
227
-
joblib.dump(svm_model_linear, 'model.joblib')
228
-
```
229
-
230
-
Register the model to your workspace with the following code. By specifying the parameters `model_framework`, `model_framework_version`, and `resource_configuration`, no-code model deployment becomes available. No-code model deployment allows you to directly deploy your model as a web service from the registered model, and the [`ResourceConfiguration`](/python/api/azureml-core/azureml.core.resource_configuration.resourceconfiguration) object defines the compute resource for the web service.
231
-
232
-
```Python
233
-
from azureml.core import Model
234
-
from azureml.core.resource_configuration import ResourceConfiguration
235
-
236
-
model = run.register_model(model_name='sklearn-iris',
The model you just registered can be deployed the exact same way as any other registered model in Azure ML. The deployment how-to
246
-
contains a section on registering models, but you can skip directly to [creating a compute target](./v1/how-to-deploy-and-where.md#choose-a-compute-target) for deployment, since you already have a registered model.
247
-
248
-
### (Preview) No-code model deployment
249
-
250
-
Instead of the traditional deployment route, you can also use the no-code deployment feature (preview) for scikit-learn. No-code model deployment is supported for all built-in scikit-learn model types. By registering your model as shown above with the `model_framework`, `model_framework_version`, and `resource_configuration` parameters, you can simply use the [`deploy()`](/python/api/azureml-core/azureml.core.model%28class%29#deploy-workspace--name--models--inference-config-none--deployment-config-none--deployment-target-none--overwrite-false-) static function to deploy your model.
NOTE: These dependencies are included in the pre-built scikit-learn inference container.
257
-
258
-
```yaml
259
-
- azureml-defaults
260
-
- inference-schema[numpy-support]
261
-
- scikit-learn
262
-
- numpy
263
-
```
264
-
265
-
The full [how-to](./v1/how-to-deploy-and-where.md) covers deployment in Azure Machine Learning in greater depth.
220
+
The model you just registered can be deployed the exact same way as any other registered model in Azure ML. For more information about deployment, see [Deploy and score a machine learning model with managed online endpoint using Python SDK v2](how-to-deploy-managed-online-endpoint-sdk-v2.md).
266
221
267
222
268
223
## Next steps
269
224
270
-
In this article, you trained and registered a scikit-learn model, and learned about deployment options. See these other articles to learn more about Azure Machine Learning.
225
+
In this article, you trained and registered a scikit-learn model, and you learned about deployment options. See these other articles to learn more about Azure Machine Learning.
271
226
272
227
*[Track run metrics during training](how-to-log-view-metrics.md)
0 commit comments