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
Copy file name to clipboardExpand all lines: articles/machine-learning/service/how-to-train-sklearn.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ Run this code on either of these environments:
34
34
-[Create a workspace configuration file](setup-create-workspace.md#write-a-configuration-file)
35
35
-[Download the sample script file](https://github.com/Azure/MachineLearningNotebooks/tree/master/how-to-use-azureml/training/train-hyperparameter-tune-deploy-with-sklearn)`train_iris.py`
36
36
37
-
You can also find a completed [Jupyter Notebook version](https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/training/train-hyperparameter-tune-deploy-with-keras/train-hyperparameter-tune-deploy-with-sklearn.ipynb) of this guide on the GitHub samples page. The notebook includes an expanded section covering intelligent hyperparameter tuning.
37
+
You can also find a completed [Jupyter Notebook version](https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/training/train-hyperparameter-tune-deploy-with-keras/train-hyperparameter-tune-deploy-with-sklearn.ipynb) of this guide on the GitHub samples page. The notebook includes an expanded section covering intelligent hyperparameter tuning and retrieving the best model by primary metrics.
38
38
39
39
## Set up the experiment
40
40
@@ -103,17 +103,17 @@ The [datastore](how-to-access-data.md) is a place where data can be stored and a
103
103
104
104
## Create a compute target
105
105
106
-
Create a compute target for your Scikit-learn job to run on. In this example, create a GPU-enabled Azure Machine Learning compute cluster. If you instead want to create CPUcompute, provide a different VM size to the vm_size parameter, such asSTANDARD_D2_V2.
106
+
Create a compute target for your Scikit-learn job to run on. Scikit learn only supports single node, CPUcomputing.
@@ -166,17 +167,19 @@ As the Run is executed, it goes through the following stages:
166
167
## Save and register the model
167
168
168
169
Once 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).
169
-
170
-
To save the model, include the following code to your training script, train_iris.py.
170
+
171
+
The following code saves the model as part of the training script, train_iris.py.
171
172
172
173
``` Python
173
-
save model code
174
+
import joblib
175
+
176
+
joblib.dump(svm_model_linear, 'model.joblib')
174
177
```
175
178
176
179
Register the model with the following code.
177
180
178
181
```Python
179
-
model = run.register_model(model_name='sklearn-iris', model_path='outputs/model')
182
+
model = run.register_model(model_name='sklearn-iris', model_path='model.joblib')
0 commit comments