Skip to content

Commit bb11c80

Browse files
committed
update samples from Release-193 as a part of 1.53.0 SDK stable release
1 parent d0961b9 commit bb11c80

File tree

96 files changed

+1116
-2055
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1116
-2055
lines changed

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Azure Machine Learning Python SDK notebooks
22

3-
4-
** **With the introduction of AzureML SDK v2, this samples repository for the v1 SDK is now deprecated and will not be monitored or updated. Users are encouraged to visit the [v2 SDK samples repository](https://github.com/Azure/azureml-examples) instead for up-to-date and enhanced examples of how to build, train, and deploy machine learning models with AzureML's newest features.** **
5-
3+
> a community-driven repository of examples using mlflow for tracking can be found at https://github.com/Azure/azureml-examples
64
75
Welcome to the Azure Machine Learning Python SDK notebooks repository!
86

configuration.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"source": [
104104
"import azureml.core\n",
105105
"\n",
106-
"print(\"This notebook was created using version 1.51.0 of the Azure ML SDK\")\n",
106+
"print(\"This notebook was created using version 1.53.0 of the Azure ML SDK\")\n",
107107
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
108108
]
109109
},
@@ -329,7 +329,7 @@
329329
" print(\"Creating new gpu-cluster\")\n",
330330
" \n",
331331
" # Specify the configuration for the new cluster\n",
332-
" compute_config = AmlCompute.provisioning_configuration(vm_size=\"STANDARD_NC6\",\n",
332+
" compute_config = AmlCompute.provisioning_configuration(vm_size=\"Standard_NC6s_v3\",\n",
333333
" min_nodes=0,\n",
334334
" max_nodes=4)\n",
335335
" # Create the cluster with the specified name and configuration\n",

contrib/RAPIDS/azure-ml-with-nvidia-rapids.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
"else:\n",
175175
" print(\"creating new cluster\")\n",
176176
" # vm_size parameter below could be modified to one of the RAPIDS-supported VM types\n",
177-
" provisioning_config = AmlCompute.provisioning_configuration(vm_size = \"Standard_NC6s_v2\", min_nodes=1, max_nodes = 1)\n",
177+
" provisioning_config = AmlCompute.provisioning_configuration(vm_size = \"Standard_NC6s_v3\", min_nodes=1, max_nodes = 1)\n",
178178
"\n",
179179
" # create the cluster\n",
180180
" gpu_cluster = ComputeTarget.create(ws, gpu_cluster_name, provisioning_config)\n",

contrib/fairness/fairlearn-azureml-mitigation.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ dependencies:
33
- pip:
44
- azureml-sdk
55
- azureml-contrib-fairness
6-
- fairlearn>=0.6.2
6+
- fairlearn>=0.6.2,<=0.7.0
77
- joblib
88
- liac-arff
9-
- raiwidgets~=0.26.0
9+
- raiwidgets~=0.28.0
1010
- itsdangerous==2.0.1
1111
- markupsafe<2.1.0
1212
- protobuf==3.20.0

contrib/fairness/upload-fairness-dashboard.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ dependencies:
33
- pip:
44
- azureml-sdk
55
- azureml-contrib-fairness
6-
- fairlearn>=0.6.2
6+
- fairlearn>=0.6.2,<=0.7.0
77
- joblib
88
- liac-arff
9-
- raiwidgets~=0.26.0
9+
- raiwidgets~=0.28.0
1010
- itsdangerous==2.0.1
1111
- markupsafe<2.1.0
1212
- protobuf==3.20.0

how-to-use-azureml/automated-machine-learning/automl_env.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ dependencies:
77
# The python interpreter version.
88
# Azure ML only supports 3.7.0 and later.
99
- pip==22.3.1
10-
- python>=3.7,<3.9
10+
- python>=3.8,<3.9
11+
- holidays==0.10.3
1112
- conda-forge::fbprophet==0.7.1
1213
- pandas==1.1.5
1314
- scipy==1.5.3
@@ -16,10 +17,10 @@ dependencies:
1617

1718
- pip:
1819
# Required packages for AzureML execution, history, and data preparation.
19-
- azureml-widgets~=1.51.0
20-
- azureml-defaults~=1.51.0
21-
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.51.0/validated_win32_requirements.txt [--no-deps]
22-
- matplotlib==3.6.2
20+
- azureml-widgets~=1.53.0
21+
- azureml-defaults~=1.53.0
22+
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.53.0/validated_win32_requirements.txt [--no-deps]
23+
- matplotlib==3.7.1
2324
- xgboost==1.3.3
2425
- cmdstanpy==0.9.5
2526
- setuptools-git==1.2

how-to-use-azureml/automated-machine-learning/automl_env_linux.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ dependencies:
77
# The python interpreter version.
88
# Azure ML only supports 3.7 and later.
99
- pip==22.3.1
10-
- python>=3.7,<3.9
11-
- matplotlib==3.2.1
10+
- python>=3.8,<3.9
11+
- matplotlib==3.7.1
1212
- numpy>=1.21.6,<=1.22.3
1313
- cython==0.29.14
1414
- urllib3==1.26.7
1515
- scipy>=1.4.1,<=1.5.3
16-
- scikit-learn==0.22.1
16+
- scikit-learn==1.1.0
1717
- py-xgboost<=1.3.3
1818
- holidays==0.10.3
1919
- conda-forge::fbprophet==0.7.1
@@ -23,10 +23,10 @@ dependencies:
2323

2424
- pip:
2525
# Required packages for AzureML execution, history, and data preparation.
26-
- azureml-widgets~=1.51.0
27-
- azureml-defaults~=1.51.0
26+
- azureml-widgets~=1.53.0
27+
- azureml-defaults~=1.53.0
2828
- pytorch-transformers==1.0.0
2929
- spacy==2.2.4
3030
- pystan==2.19.1.1
3131
- https://aka.ms/automl-resources/packages/en_core_web_sm-2.1.0.tar.gz
32-
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.51.0/validated_linux_requirements.txt [--no-deps]
32+
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.53.0/validated_linux_requirements.txt [--no-deps]

how-to-use-azureml/automated-machine-learning/automl_env_mac.yml

+7-11
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,22 @@ dependencies:
77
# The python interpreter version.
88
# Currently Azure ML only supports 3.7 and later.
99
- pip==22.3.1
10-
- python>=3.7,<3.9
11-
- matplotlib==3.2.1
10+
- python>=3.8,<3.9
1211
- numpy>=1.21.6,<=1.22.3
1312
- cython==0.29.14
14-
- urllib3==1.26.7
1513
- scipy>=1.4.1,<=1.5.3
16-
- scikit-learn==0.22.1
17-
- py-xgboost<=1.3.3
14+
- scikit-learn==1.1.0
1815
- holidays==0.10.3
19-
- pytorch::pytorch=1.11.0
20-
- cudatoolkit=9.0
21-
- notebook
2216

2317
- pip:
2418
# Required packages for AzureML execution, history, and data preparation.
25-
- azureml-widgets~=1.51.0
26-
- azureml-defaults~=1.51.0
19+
- azureml-widgets~=1.53.0
20+
- azureml-defaults~=1.53.0
2721
- pytorch-transformers==1.0.0
2822
- spacy==2.2.4
2923
- pystan==2.19.1.1
3024
- fbprophet==0.7.1
25+
- xgboost==1.3.3
26+
- matplotlib==3.7.1
3127
- https://aka.ms/automl-resources/packages/en_core_web_sm-2.1.0.tar.gz
32-
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.51.0/validated_darwin_requirements.txt [--no-deps]
28+
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.53.0/validated_darwin_requirements.txt [--no-deps]

how-to-use-azureml/automated-machine-learning/classification-bank-marketing-all-features/auto-ml-classification-bank-marketing-all-features.ipynb

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"Copyright (c) Microsoft Corporation. All rights reserved.\n",
8+
"\n",
9+
"Licensed under the MIT License."
10+
]
11+
},
12+
{
13+
"cell_type": "markdown",
14+
"metadata": {},
15+
"source": [
16+
"![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/classification-bank-marketing-all-features/auto-ml-classification-bank-marketing-all-features.png)"
17+
]
18+
},
319
{
420
"cell_type": "markdown",
521
"metadata": {},
@@ -830,9 +846,7 @@
830846
{
831847
"cell_type": "code",
832848
"execution_count": null,
833-
"metadata": {
834-
"scrolled": true
835-
},
849+
"metadata": {},
836850
"outputs": [],
837851
"source": [
838852
"%matplotlib notebook\n",

how-to-use-azureml/automated-machine-learning/classification-credit-card-fraud/auto-ml-classification-credit-card-fraud.ipynb

+16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"Copyright (c) Microsoft Corporation. All rights reserved.\n",
8+
"\n",
9+
"Licensed under the MIT License."
10+
]
11+
},
12+
{
13+
"cell_type": "markdown",
14+
"metadata": {},
15+
"source": [
16+
"![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/classification-credit-card-fraud/auto-ml-classification-credit-card-fraud.png)"
17+
]
18+
},
319
{
420
"cell_type": "markdown",
521
"metadata": {},

how-to-use-azureml/automated-machine-learning/classification-text-dnn/auto-ml-classification-text-dnn.ipynb

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"Copyright (c) Microsoft Corporation. All rights reserved.\n",
8+
"\n",
9+
"Licensed under the MIT License."
10+
]
11+
},
12+
{
13+
"cell_type": "markdown",
14+
"metadata": {},
15+
"source": [
16+
"![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/classification-text-dnn/auto-ml-classification-text-dnn.png)"
17+
]
18+
},
319
{
420
"cell_type": "markdown",
521
"metadata": {},
@@ -139,8 +155,8 @@
139155
" print(\"Found existing cluster, use it.\")\n",
140156
"except ComputeTargetException:\n",
141157
" compute_config = AmlCompute.provisioning_configuration(\n",
142-
" vm_size=\"STANDARD_NC6\", # CPU for BiLSTM, such as \"STANDARD_D2_V2\"\n",
143-
" # To use BERT (this is recommended for best performance), select a GPU such as \"STANDARD_NC6\"\n",
158+
" vm_size=\"Standard_NC6s_v3\", # CPU for BiLSTM, such as \"STANDARD_D2_V2\"\n",
159+
" # To use BERT (this is recommended for best performance), select a GPU such as \"Standard_NC6s_v3\"\n",
144160
" # or similar GPU option\n",
145161
" # available in your workspace\n",
146162
" idle_seconds_before_scaledown=60,\n",
@@ -336,7 +352,7 @@
336352
"metadata": {},
337353
"source": [
338354
"For local inferencing, you can load the model locally via. the method `remote_run.get_output()`. For more information on the arguments expected by this method, you can run `remote_run.get_output??`.\n",
339-
"Note that when the model contains BERT, this step will require pytorch and pytorch-transformers installed in your local environment. The exact versions of these packages can be found in the **automl_env.yml** file located in the local copy of your azureml-examples folder here: \"azureml-examples/python-sdk/tutorials/automl-with-azureml\""
355+
"Note that when the model contains BERT, this step will require pytorch and pytorch-transformers installed in your local environment. The exact versions of these packages can be found in the **automl_env.yml** file located in the local copy of your MachineLearningNotebooks folder here: \"MachineLearningNotebooks\\how-to-use-azureml\\automated-machine-learning\""
340356
]
341357
},
342358
{

how-to-use-azureml/automated-machine-learning/classification-text-dnn/helper.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import json
12
import pandas as pd
23
from azureml.core import Environment, ScriptRunConfig
34
from azureml.core.run import Run
@@ -13,7 +14,16 @@ def run_inference(
1314
model_name,
1415
):
1516

16-
inference_env = train_run.get_environment()
17+
try:
18+
inference_env = train_run.get_environment()
19+
except BaseException:
20+
run_details = train_run.get_details()
21+
run_def = run_details.get("runDefinition")
22+
env = run_def.get("environment")
23+
if env is None:
24+
raise
25+
json.dump(env, open("azureml_environment.json", "w"))
26+
inference_env = Environment.load_from_directory(".")
1727

1828
est = ScriptRunConfig(
1929
source_directory=script_folder,

how-to-use-azureml/automated-machine-learning/classification-text-dnn/infer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pandas as pd
44
import numpy as np
55

6-
from sklearn.externals import joblib
6+
import joblib
77

88
from azureml.automl.runtime.shared.score import scoring, constants
99
from azureml.core import Run, Dataset

how-to-use-azureml/automated-machine-learning/continuous-retraining/auto-ml-continuous-retraining.ipynb

+16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"Copyright (c) Microsoft Corporation. All rights reserved.\n",
8+
"\n",
9+
"Licensed under the MIT License."
10+
]
11+
},
12+
{
13+
"cell_type": "markdown",
14+
"metadata": {},
15+
"source": [
16+
"![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/continuous-retraining/auto-ml-continuous-retraining.png)"
17+
]
18+
},
319
{
420
"cell_type": "markdown",
521
"metadata": {},

how-to-use-azureml/automated-machine-learning/continuous-retraining/check_data.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
model = Model(ws, args.model_name)
3232
last_train_time = model.created_time
3333
print("Model was last trained on {0}.".format(last_train_time))
34-
except Exception as e:
34+
except Exception:
3535
print("Could not get last model train time.")
3636
last_train_time = datetime.min.replace(tzinfo=pytz.UTC)
3737

how-to-use-azureml/automated-machine-learning/experimental/autofeaturization-codegen/codegen-for-autofeaturization.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"metadata": {},
9898
"outputs": [],
9999
"source": [
100-
"print(\"This notebook was created using version 1.51.0 of the Azure ML SDK\")\n",
100+
"print(\"This notebook was created using version 1.53.0 of the Azure ML SDK\")\n",
101101
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
102102
]
103103
},

how-to-use-azureml/automated-machine-learning/experimental/autofeaturization-custom-model-training/custom-model-training-from-autofeaturization-run.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"metadata": {},
9898
"outputs": [],
9999
"source": [
100-
"print(\"This notebook was created using version 1.51.0 of the Azure ML SDK\")\n",
100+
"print(\"This notebook was created using version 1.53.0 of the Azure ML SDK\")\n",
101101
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
102102
]
103103
},
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
11
name: azure_automl_experimental
22
dependencies:
33
# The python interpreter version.
4-
<<<<<<< HEAD
5-
# Currently Azure ML only supports 3.6.0 and later.
6-
- pip<=20.2.4
7-
- python>=3.6.0,<3.10
8-
- cython==0.29.14
9-
- urllib3==1.26.7
10-
- PyJWT < 2.0.0
11-
- numpy==1.22.3
12-
- pywin32==227
13-
- cryptography<37.0.0
14-
=======
154
# Currently Azure ML only supports 3.7.0 and later.
165
- pip<=22.3.1
176
- python>=3.7.0,<3.11
18-
>>>>>>> 4671acd451ce979c3cebcd3917804861a333b710
197

208
- pip:
219
# Required packages for AzureML execution, history, and data preparation.
@@ -25,4 +13,3 @@ dependencies:
2513
- azureml-mlflow
2614
- pandas
2715
- mlflow
28-
- docker<6.0.0

how-to-use-azureml/automated-machine-learning/experimental/classification-credit-card-fraud-local-managed/auto-ml-classification-credit-card-fraud-local-managed.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"metadata": {},
9393
"outputs": [],
9494
"source": [
95-
"print(\"This notebook was created using version 1.51.0 of the Azure ML SDK\")\n",
95+
"print(\"This notebook was created using version 1.53.0 of the Azure ML SDK\")\n",
9696
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
9797
]
9898
},

how-to-use-azureml/automated-machine-learning/experimental/regression-model-proxy/auto-ml-regression-model-proxy.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"metadata": {},
9292
"outputs": [],
9393
"source": [
94-
"print(\"This notebook was created using version 1.51.0 of the Azure ML SDK\")\n",
94+
"print(\"This notebook was created using version 1.53.0 of the Azure ML SDK\")\n",
9595
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
9696
]
9797
},

how-to-use-azureml/automated-machine-learning/forecasting-backtest-many-models/auto-ml-forecasting-backtest-many-models.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"cell_type": "markdown",
1414
"metadata": {},
1515
"source": [
16-
"![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/forecasting-hierarchical-timeseries/auto-ml-forecasting-hierarchical-timeseries.png)"
16+
"![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/forecasting-backtest-many-models/auto-ml-forecasting-backtest-many-models.png)"
1717
]
1818
},
1919
{

how-to-use-azureml/automated-machine-learning/forecasting-backtest-single-model/auto-ml-forecasting-backtest-single-model.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"Copyright (c) Microsoft Corporation. All rights reserved.\n",
88
"\n",
99
"Licensed under the MIT License.\n",
10-
"![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/automl-forecasting-function.png)"
10+
"![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/auto-ml-forecasting-backtest-single-model.png)"
1111
]
1212
},
1313
{

0 commit comments

Comments
 (0)