Skip to content

Commit b88a312

Browse files
author
raoberman
authored
Update how-to-train-scikit-learn.md
1 parent 0144e5a commit b88a312

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

articles/machine-learning/how-to-train-scikit-learn.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ Next, use the YAML file to create and register this custom environment in your w
110110

111111
For more information on creating and using environments, see [Create and use software environments in Azure Machine Learning](how-to-use-environments.md).
112112

113+
##### [Optional] Create a custom environment with Intel® Extension for Scikit-Learn
114+
115+
Want to speed up your scikit-learn scripts on Intel hardware? Try adding [Intel® Extension for Scikit-Learn](https://www.intel.com/content/www/us/en/developer/tools/oneapi/scikit-learn.html) into your conda yaml file and following the subsequent steps detailed above. We will show you how to enable these optimizations later in this example:
116+
[!notebook-python[](~/azureml-examples-main/sdk/python/jobs/single-step/scikit-learn/train-hyperparameter-tune-deploy-with-sklearn/train-hyperparameter-tune-with-sklearn.ipynb?name=make_conda_file)]
117+
113118
## Configure and submit your training job
114119

115120
In this section, we'll cover how to run a training job, using a training script that we've provided. To begin, you'll build the training job by configuring the command for running the training script. Then, you'll submit the training job to run in Azure Machine Learning.
@@ -135,6 +140,14 @@ Next, create the script file in the source directory.
135140

136141
[!notebook-python[](~/azureml-examples-main/sdk/python/jobs/single-step/scikit-learn/train-hyperparameter-tune-deploy-with-sklearn/train-hyperparameter-tune-with-sklearn.ipynb?name=create_script_file)]
137142

143+
#### [Optional] Enable Intel® Extension for Scikit-Learn optimizations for more performance on Intel hardware
144+
145+
If you have installed Intel® Extension for Scikit-Learn (as demonstrated in the previous section), you can enable the performance optimizations by adding the two lines of code to the top of the script file, as shown below.
146+
147+
To learn more about Intel® Extension for Scikit-Learn, visit the package's [documentation](https://intel.github.io/scikit-learn-intelex/).
148+
149+
[!notebook-python[](~/azureml-examples-main/sdk/python/jobs/single-step/scikit-learn/train-hyperparameter-tune-deploy-with-sklearn/train-hyperparameter-tune-with-sklearn.ipynb?name=create_script_file)]
150+
138151
### Build the training job
139152

140153
Now that you have all the assets required to run your job, it's time to build it using the Azure Machine Learning Python SDK v2. For this, we'll be creating a `command`.
@@ -217,4 +230,4 @@ After you've registered your model, you can deploy it the same way as any other
217230
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.
218231

219232
* [Track run metrics during training](how-to-log-view-metrics.md)
220-
* [Tune hyperparameters](how-to-tune-hyperparameters.md)
233+
* [Tune hyperparameters](how-to-tune-hyperparameters.md)

0 commit comments

Comments
 (0)