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/tutorial-azure-ml-in-a-day.md
+121Lines changed: 121 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -215,6 +215,127 @@ You might need to select **Refresh** to see the new folder and script in your **
215
215
216
216
:::image type="content" source="media/tutorial-azure-ml-in-a-day/refresh.png" alt-text="Screenshot shows the refresh icon.":::
217
217
218
+
### [Optional] Enable Intel® Extension for Scikit-Learn optimizations for more performance on Intel hardware
219
+
220
+
Want to speed up your scikit-learn scripts on Intel hardware? Try enabling [Intel® Extension for Scikit-Learn](https://www.intel.com/content/www/us/en/developer/tools/oneapi/scikit-learn.html) in your training script. Intel® Extension for Scikit-Learn is already installed in the Azure Machine Learning curated environment used in this tutorial, so no additional installation is needed.
221
+
222
+
To learn more about Intel® Extension for Scikit-Learn, visit the package's [documentation](https://intel.github.io/scikit-learn-intelex/).
223
+
224
+
If you want to use Intel® Extension for Scikit-Learn as part of the training script described above, you can enable the performance optimizations by adding the two lines of code to the top of the script file, as shown below.
225
+
226
+
227
+
```python
228
+
%%writefile {train_src_dir}/main.py
229
+
import os
230
+
import argparse
231
+
232
+
# Import and enable Intel Extension for Scikit-learn optimizations
233
+
# where possible
234
+
from sklearnex import patch_sklearn
235
+
patch_sklearn()
236
+
237
+
import pandas as pd
238
+
import mlflow
239
+
import mlflow.sklearn
240
+
from sklearn.ensemble import GradientBoostingClassifier
241
+
from sklearn.metrics import classification_report
242
+
from sklearn.model_selection import train_test_split
243
+
244
+
defmain():
245
+
"""Main function of the script."""
246
+
247
+
# input and output arguments
248
+
parser = argparse.ArgumentParser()
249
+
parser.add_argument("--data", type=str, help="path to input data")
0 commit comments