Skip to content

Commit b881f78

Browse files
authored
Merge pull request Azure#918 from Azure/release_update_stablev2/Release-6
update samples from Release-6 as a part of 1.3.0 SDK stable release
2 parents c520bd1 + 057e22b commit b881f78

File tree

83 files changed

+3026
-1251
lines changed

Some content is hidden

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

83 files changed

+3026
-1251
lines changed

configuration.ipynb

Lines changed: 1 addition & 1 deletion
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.2.0 of the Azure ML SDK\")\n",
106+
"print(\"This notebook was created using version 1.3.0 of the Azure ML SDK\")\n",
107107
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
108108
]
109109
},

how-to-use-azureml/automated-machine-learning/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ jupyter notebook
117117
- Simple example of using automated ML for regression
118118
- Uses azure compute for training
119119

120-
- [auto-ml-regression-hardware-performance-explanation-and-featurization.ipynb](regression-hardware-performance-explanation-and-featurization/auto-ml-regression-hardware-performance-explanation-and-featurization.ipynb)
120+
- [auto-ml-regression-explanation-featurization.ipynb](regression-explanation-featurization/auto-ml-regression-explanation-featurization.ipynb)
121121
- Dataset: Hardware Performance Dataset
122122
- Shows featurization and excplanation
123123
- Uses azure compute for training
@@ -152,7 +152,7 @@ jupyter notebook
152152
- Beer Production Forecasting
153153

154154
- [auto-ml-continuous-retraining.ipynb](continuous-retraining/auto-ml-continuous-retraining.ipynb)
155-
- Continous retraining using Pipelines and Time-Series TabularDataset
155+
- Continuous retraining using Pipelines and Time-Series TabularDataset
156156

157157
- [auto-ml-classification-text-dnn.ipynb](classification-text-dnn/auto-ml-classification-text-dnn.ipynb)
158158
- Classification with text data using deep learning in AutoML

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ dependencies:
2626
- azureml-train
2727
- azureml-widgets
2828
- azureml-pipeline
29-
- azureml-contrib-interpret
3029
- pytorch-transformers==1.0.0
3130
- spacy==2.1.8
3231
- onnxruntime==1.0.0

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ dependencies:
2727
- azureml-train
2828
- azureml-widgets
2929
- azureml-pipeline
30-
- azureml-contrib-interpret
3130
- pytorch-transformers==1.0.0
3231
- spacy==2.1.8
3332
- onnxruntime==1.0.0
@@ -36,4 +35,4 @@ dependencies:
3635
channels:
3736
- anaconda
3837
- conda-forge
39-
- pytorch
38+
- pytorch

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

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,23 @@
9292
"from azureml.explain.model._internal.explanation_client import ExplanationClient"
9393
]
9494
},
95+
{
96+
"cell_type": "markdown",
97+
"metadata": {},
98+
"source": [
99+
"This sample notebook may use features that are not available in previous versions of the Azure ML SDK."
100+
]
101+
},
102+
{
103+
"cell_type": "code",
104+
"execution_count": null,
105+
"metadata": {},
106+
"outputs": [],
107+
"source": [
108+
"print(\"This notebook was created using version 1.3.0 of the Azure ML SDK\")\n",
109+
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
110+
]
111+
},
95112
{
96113
"cell_type": "markdown",
97114
"metadata": {},
@@ -132,7 +149,6 @@
132149
"experiment=Experiment(ws, experiment_name)\n",
133150
"\n",
134151
"output = {}\n",
135-
"output['SDK version'] = azureml.core.VERSION\n",
136152
"output['Subscription ID'] = ws.subscription_id\n",
137153
"output['Workspace'] = ws.name\n",
138154
"output['Resource Group'] = ws.resource_group\n",
@@ -160,35 +176,22 @@
160176
"metadata": {},
161177
"outputs": [],
162178
"source": [
163-
"from azureml.core.compute import AmlCompute\n",
164-
"from azureml.core.compute import ComputeTarget\n",
179+
"from azureml.core.compute import ComputeTarget, AmlCompute\n",
180+
"from azureml.core.compute_target import ComputeTargetException\n",
165181
"\n",
166-
"# Choose a name for your cluster.\n",
167-
"amlcompute_cluster_name = \"cpu-cluster-4\"\n",
182+
"# Choose a name for your CPU cluster\n",
183+
"cpu_cluster_name = \"cpu-cluster-4\"\n",
168184
"\n",
169-
"found = False\n",
170-
"# Check if this compute target already exists in the workspace.\n",
171-
"cts = ws.compute_targets\n",
172-
"if amlcompute_cluster_name in cts and cts[amlcompute_cluster_name].type == 'AmlCompute':\n",
173-
" found = True\n",
174-
" print('Found existing compute target.')\n",
175-
" compute_target = cts[amlcompute_cluster_name]\n",
176-
" \n",
177-
"if not found:\n",
178-
" print('Creating a new compute target...')\n",
179-
" provisioning_config = AmlCompute.provisioning_configuration(vm_size = \"STANDARD_D2_V2\", # for GPU, use \"STANDARD_NC6\"\n",
180-
" #vm_priority = 'lowpriority', # optional\n",
181-
" max_nodes = 6)\n",
182-
"\n",
183-
" # Create the cluster.\n",
184-
" compute_target = ComputeTarget.create(ws, amlcompute_cluster_name, provisioning_config)\n",
185-
" \n",
186-
"print('Checking cluster status...')\n",
187-
"# Can poll for a minimum number of nodes and for a specific timeout.\n",
188-
"# If no min_node_count is provided, it will use the scale settings for the cluster.\n",
189-
"compute_target.wait_for_completion(show_output = True, min_node_count = None, timeout_in_minutes = 20)\n",
190-
" \n",
191-
"# For a more detailed view of current AmlCompute status, use get_status()."
185+
"# Verify that cluster does not exist already\n",
186+
"try:\n",
187+
" compute_target = ComputeTarget(workspace=ws, name=cpu_cluster_name)\n",
188+
" print('Found existing cluster, use it.')\n",
189+
"except ComputeTargetException:\n",
190+
" compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D2_V2',\n",
191+
" max_nodes=6)\n",
192+
" compute_target = ComputeTarget.create(ws, cpu_cluster_name, compute_config)\n",
193+
"\n",
194+
"compute_target.wait_for_completion(show_output=True)"
192195
]
193196
},
194197
{
@@ -394,8 +397,6 @@
394397
"outputs": [],
395398
"source": [
396399
"#from azureml.train.automl.run import AutoMLRun\n",
397-
"#experiment_name = 'automl-classification-bmarketing'\n",
398-
"#experiment = Experiment(ws, experiment_name)\n",
399400
"#remote_run = AutoMLRun(experiment=experiment, run_id='<run_ID_goes_here')\n",
400401
"#remote_run"
401402
]

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,3 @@ dependencies:
66
- azureml-widgets
77
- matplotlib
88
- onnxruntime==1.0.0
9-
- azureml-explain-model
10-
- azureml-contrib-interpret

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,23 @@
8080
"from azureml.train.automl import AutoMLConfig"
8181
]
8282
},
83+
{
84+
"cell_type": "markdown",
85+
"metadata": {},
86+
"source": [
87+
"This sample notebook may use features that are not available in previous versions of the Azure ML SDK."
88+
]
89+
},
90+
{
91+
"cell_type": "code",
92+
"execution_count": null,
93+
"metadata": {},
94+
"outputs": [],
95+
"source": [
96+
"print(\"This notebook was created using version 1.3.0 of the Azure ML SDK\")\n",
97+
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
98+
]
99+
},
83100
{
84101
"cell_type": "code",
85102
"execution_count": null,
@@ -94,7 +111,6 @@
94111
"experiment=Experiment(ws, experiment_name)\n",
95112
"\n",
96113
"output = {}\n",
97-
"output['SDK version'] = azureml.core.VERSION\n",
98114
"output['Subscription ID'] = ws.subscription_id\n",
99115
"output['Workspace'] = ws.name\n",
100116
"output['Resource Group'] = ws.resource_group\n",

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ dependencies:
55
- azureml-train-automl
66
- azureml-widgets
77
- matplotlib
8-
- azureml-explain-model

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

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
"Notebook synopsis:\n",
4848
"1. Creating an Experiment in an existing Workspace\n",
4949
"2. Configuration and remote run of AutoML for a text dataset (20 Newsgroups dataset from scikit-learn) for classification\n",
50-
"3. Evaluating the final model on a test set\n",
51-
"4. Deploying the model on ACI"
50+
"3. Registering the best model for future use\n",
51+
"4. Evaluating the final model on a test set"
5252
]
5353
},
5454
{
@@ -84,6 +84,23 @@
8484
"from sklearn.datasets import fetch_20newsgroups"
8585
]
8686
},
87+
{
88+
"cell_type": "markdown",
89+
"metadata": {},
90+
"source": [
91+
"This sample notebook may use features that are not available in previous versions of the Azure ML SDK."
92+
]
93+
},
94+
{
95+
"cell_type": "code",
96+
"execution_count": null,
97+
"metadata": {},
98+
"outputs": [],
99+
"source": [
100+
"print(\"This notebook was created using version 1.3.0 of the Azure ML SDK\")\n",
101+
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
102+
]
103+
},
87104
{
88105
"cell_type": "markdown",
89106
"metadata": {},
@@ -105,7 +122,6 @@
105122
"experiment = Experiment(ws, experiment_name)\n",
106123
"\n",
107124
"output = {}\n",
108-
"output['SDK version'] = azureml.core.VERSION\n",
109125
"output['Subscription ID'] = ws.subscription_id\n",
110126
"output['Workspace Name'] = ws.name\n",
111127
"output['Resource Group'] = ws.resource_group\n",
@@ -132,34 +148,25 @@
132148
"metadata": {},
133149
"outputs": [],
134150
"source": [
151+
"from azureml.core.compute import ComputeTarget, AmlCompute\n",
152+
"from azureml.core.compute_target import ComputeTargetException\n",
153+
"\n",
135154
"# Choose a name for your cluster.\n",
136155
"amlcompute_cluster_name = \"dnntext-cluster\"\n",
137156
"\n",
138-
"found = False\n",
139-
"# Check if this compute target already exists in the workspace.\n",
140-
"cts = ws.compute_targets\n",
141-
"if amlcompute_cluster_name in cts and cts[amlcompute_cluster_name].type == 'AmlCompute':\n",
142-
" found = True\n",
143-
" print('Found existing compute target.')\n",
144-
" compute_target = cts[amlcompute_cluster_name]\n",
145-
"\n",
146-
"if not found:\n",
147-
" print('Creating a new compute target...')\n",
148-
" provisioning_config = AmlCompute.provisioning_configuration(vm_size = \"STANDARD_NC6\", # CPU for BiLSTM, such as \"STANDARD_D2_V2\" \n",
149-
" # To use BERT (this is recommended for best performance), select a GPU such as \"STANDARD_NC6\" \n",
150-
" # or similar GPU option\n",
151-
" # available in your workspace\n",
152-
" max_nodes = 1)\n",
153-
"\n",
154-
" # Create the cluster\n",
155-
" compute_target = ComputeTarget.create(ws, amlcompute_cluster_name, provisioning_config)\n",
156-
"\n",
157-
"print('Checking cluster status...')\n",
158-
"# Can poll for a minimum number of nodes and for a specific timeout.\n",
159-
"# If no min_node_count is provided, it will use the scale settings for the cluster.\n",
160-
"compute_target.wait_for_completion(show_output = True, min_node_count = None, timeout_in_minutes = 20)\n",
157+
"# Verify that cluster does not exist already\n",
158+
"try:\n",
159+
" compute_target = ComputeTarget(workspace=ws, name=amlcompute_cluster_name)\n",
160+
" print('Found existing cluster, use it.')\n",
161+
"except ComputeTargetException:\n",
162+
" compute_config = AmlCompute.provisioning_configuration(vm_size = \"STANDARD_NC6\", # CPU for BiLSTM, such as \"STANDARD_D2_V2\" \n",
163+
" # To use BERT (this is recommended for best performance), select a GPU such as \"STANDARD_NC6\" \n",
164+
" # or similar GPU option\n",
165+
" # available in your workspace\n",
166+
" max_nodes = 1)\n",
167+
" compute_target = ComputeTarget.create(ws, amlcompute_cluster_name, compute_config)\n",
161168
"\n",
162-
"# For a more detailed view of current AmlCompute status, use get_status()."
169+
"compute_target.wait_for_completion(show_output=True)"
163170
]
164171
},
165172
{
@@ -373,8 +380,8 @@
373380
"cell_type": "markdown",
374381
"metadata": {},
375382
"source": [
376-
"### Deploying the model\n",
377-
"We now use the best fitted model from the AutoML Run to make predictions on the test set. "
383+
"### Registering the best model\n",
384+
"We now register the best fitted model from the AutoML Run for use in future deployments. "
378385
]
379386
},
380387
{

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

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"metadata": {},
2121
"source": [
2222
"# Automated Machine Learning \n",
23-
"**Continous retraining using Pipelines and Time-Series TabularDataset**\n",
23+
"**Continuous retraining using Pipelines and Time-Series TabularDataset**\n",
2424
"## Contents\n",
2525
"1. [Introduction](#Introduction)\n",
2626
"2. [Setup](#Setup)\n",
@@ -75,6 +75,23 @@
7575
"from azureml.train.automl import AutoMLConfig"
7676
]
7777
},
78+
{
79+
"cell_type": "markdown",
80+
"metadata": {},
81+
"source": [
82+
"This sample notebook may use features that are not available in previous versions of the Azure ML SDK."
83+
]
84+
},
85+
{
86+
"cell_type": "code",
87+
"execution_count": null,
88+
"metadata": {},
89+
"outputs": [],
90+
"source": [
91+
"print(\"This notebook was created using version 1.3.0 of the Azure ML SDK\")\n",
92+
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
93+
]
94+
},
7895
{
7996
"cell_type": "markdown",
8097
"metadata": {},
@@ -112,7 +129,6 @@
112129
"experiment = Experiment(ws, experiment_name)\n",
113130
"\n",
114131
"output = {}\n",
115-
"output['SDK version'] = azureml.core.VERSION\n",
116132
"output['Subscription ID'] = ws.subscription_id\n",
117133
"output['Workspace'] = ws.name\n",
118134
"output['Resource Group'] = ws.resource_group\n",
@@ -143,33 +159,22 @@
143159
"metadata": {},
144160
"outputs": [],
145161
"source": [
146-
"from azureml.core.compute import AmlCompute, ComputeTarget\n",
162+
"from azureml.core.compute import ComputeTarget, AmlCompute\n",
163+
"from azureml.core.compute_target import ComputeTargetException\n",
147164
"\n",
148-
"# Choose a name for your cluster.\n",
149-
"amlcompute_cluster_name = \"cpu-cluster-42\"\n",
165+
"# Choose a name for your CPU cluster\n",
166+
"amlcompute_cluster_name = \"cont-cluster\"\n",
150167
"\n",
151-
"found = False\n",
152-
"# Check if this compute target already exists in the workspace.\n",
153-
"cts = ws.compute_targets\n",
154-
"if amlcompute_cluster_name in cts and cts[amlcompute_cluster_name].type == 'AmlCompute':\n",
155-
" found = True\n",
156-
" print('Found existing compute target.')\n",
157-
" compute_target = cts[amlcompute_cluster_name]\n",
158-
" \n",
159-
"if not found:\n",
160-
" print('Creating a new compute target...')\n",
161-
" provisioning_config = AmlCompute.provisioning_configuration(vm_size = \"STANDARD_D2_V2\", # for GPU, use \"STANDARD_NC6\"\n",
162-
" #vm_priority = 'lowpriority', # optional\n",
163-
" max_nodes = 4)\n",
168+
"# Verify that cluster does not exist already\n",
169+
"try:\n",
170+
" compute_target = ComputeTarget(workspace=ws, name=amlcompute_cluster_name)\n",
171+
" print('Found existing cluster, use it.')\n",
172+
"except ComputeTargetException:\n",
173+
" compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D2_V2',\n",
174+
" max_nodes=4)\n",
175+
" compute_target = ComputeTarget.create(ws, amlcompute_cluster_name, compute_config)\n",
164176
"\n",
165-
" # Create the cluster.\n",
166-
" compute_target = ComputeTarget.create(ws, amlcompute_cluster_name, provisioning_config)\n",
167-
" \n",
168-
" # Can poll for a minimum number of nodes and for a specific timeout.\n",
169-
" # If no min_node_count is provided, it will use the scale settings for the cluster.\n",
170-
" compute_target.wait_for_completion(show_output = True, min_node_count = 0, timeout_in_minutes = 10)\n",
171-
" \n",
172-
" # For a more detailed view of current AmlCompute status, use get_status()."
177+
"compute_target.wait_for_completion(show_output=True)"
173178
]
174179
},
175180
{

0 commit comments

Comments
 (0)