Skip to content

Commit ed91e39

Browse files
committed
update samples from Release-38 as a part of SDK release
1 parent a09a1a1 commit ed91e39

File tree

80 files changed

+4469
-102
lines changed

Some content is hidden

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

80 files changed

+4469
-102
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.1.0rc0 of the Azure ML SDK\")\n",
106+
"print(\"This notebook was created using version 1.1.0rc1 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/automl_env.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ dependencies:
2323
- azureml-train-automl
2424
- azureml-train
2525
- azureml-widgets
26-
- azureml-explain-model
2726
- azureml-pipeline
2827
- azureml-contrib-interpret
2928
- pytorch-transformers==1.0.0
@@ -34,4 +33,4 @@ dependencies:
3433

3534
channels:
3635
- conda-forge
37-
- pytorch
36+
- pytorch

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
@@ -24,7 +24,6 @@ dependencies:
2424
- azureml-train-automl
2525
- azureml-train
2626
- azureml-widgets
27-
- azureml-explain-model
2827
- azureml-pipeline
2928
- azureml-contrib-interpret
3029
- pytorch-transformers==1.0.0
@@ -35,4 +34,4 @@ dependencies:
3534

3635
channels:
3736
- conda-forge
38-
- pytorch
37+
- pytorch

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
" \"primary_metric\": 'average_precision_score_weighted',\n",
213213
" \"enable_early_stopping\": True,\n",
214214
" \"max_concurrent_iterations\": 2, # This is a limit for testing purpose, please increase it as per cluster size\n",
215-
" \"experiment_timeout_hours\": 0.2, # This is a time limit for testing purposes, remove it for real use cases, this will drastically limit ablity to find the best model possible\n",
215+
" \"experiment_timeout_hours\": 0.25, # This is a time limit for testing purposes, remove it for real use cases, this will drastically limit ablity to find the best model possible\n",
216216
" \"verbosity\": logging.INFO,\n",
217217
"}\n",
218218
"\n",

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

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@
121121
"metadata": {},
122122
"source": [
123123
"## Set up a compute cluster\n",
124-
"This section uses a user-provided compute cluster (named \"cpu-cluster\" in this example). If a cluster with this name does not exist in the user's workspace, the below code will create a new cluster. You can choose the parameters of the cluster as mentioned in the comments.\n",
124+
"This section uses a user-provided compute cluster (named \"dnntext-cluster\" in this example). If a cluster with this name does not exist in the user's workspace, the below code will create a new cluster. You can choose the parameters of the cluster as mentioned in the comments.\n",
125125
"\n",
126-
"Whether you provide/select a CPU or GPU cluster, AutoML will choose the appropriate DNN for that setup - BiLSTM or BERT text featurizer will be included in the candidate featurizers on CPU and GPU respectively."
126+
"Whether you provide/select a CPU or GPU cluster, AutoML will choose the appropriate DNN for that setup - BiLSTM or BERT text featurizer will be included in the candidate featurizers on CPU and GPU respectively. If your goal is to obtain the most accurate model, we recommend you use GPU clusters since BERT featurizers usually outperform BiLSTM featurizers."
127127
]
128128
},
129129
{
@@ -133,7 +133,7 @@
133133
"outputs": [],
134134
"source": [
135135
"# Choose a name for your cluster.\n",
136-
"amlcompute_cluster_name = \"cpu-dnntext\"\n",
136+
"amlcompute_cluster_name = \"dnntext-cluster\"\n",
137137
"\n",
138138
"found = False\n",
139139
"# Check if this compute target already exists in the workspace.\n",
@@ -145,11 +145,11 @@
145145
"\n",
146146
"if not found:\n",
147147
" print('Creating a new compute target...')\n",
148-
" provisioning_config = AmlCompute.provisioning_configuration(vm_size = \"STANDARD_D2_V2\", # CPU for BiLSTM\n",
149-
" # To use BERT, select a GPU such as \"STANDARD_NC6\" \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",
150150
" # or similar GPU option\n",
151151
" # available in your workspace\n",
152-
" max_nodes = 6)\n",
152+
" max_nodes = 1)\n",
153153
"\n",
154154
" # Create the cluster\n",
155155
" compute_target = ComputeTarget.create(ws, amlcompute_cluster_name, provisioning_config)\n",
@@ -218,7 +218,7 @@
218218
"cell_type": "markdown",
219219
"metadata": {},
220220
"source": [
221-
"Featch data and upload to datastore for use in training"
221+
"#### Fetch data and upload to datastore for use in training"
222222
]
223223
},
224224
{
@@ -347,7 +347,26 @@
347347
"metadata": {},
348348
"outputs": [],
349349
"source": [
350-
"#best_run, fitted_model = automl_run.get_output()"
350+
"best_run, fitted_model = automl_run.get_output()"
351+
]
352+
},
353+
{
354+
"cell_type": "markdown",
355+
"metadata": {},
356+
"source": [
357+
"You can now see what text transformations are used to convert text data to features for this dataset, including deep learning transformations based on BiLSTM or Transformer (BERT is one implementation of a Transformer) models."
358+
]
359+
},
360+
{
361+
"cell_type": "code",
362+
"execution_count": null,
363+
"metadata": {},
364+
"outputs": [],
365+
"source": [
366+
"text_transformations_used = []\n",
367+
"for column_group in fitted_model.named_steps['datatransformer'].get_featurization_summary():\n",
368+
" text_transformations_used.extend(column_group['Transformations'])\n",
369+
"text_transformations_used"
351370
]
352371
},
353372
{

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ dependencies:
66
- azureml-widgets
77
- matplotlib
88
- azurmel-train
9+
- https://download.pytorch.org/whl/cpu/torch-1.1.0-cp35-cp35m-win_amd64.whl
10+
- sentencepiece==0.1.82
11+
- pytorch-transformers==1.0
12+
- spacy==2.1.8
13+
- https://aka.ms/automl-resources/packages/en_core_web_sm-2.1.0.tar.gz

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
"conda_run_config.environment.docker.base_image = azureml.core.runconfig.DEFAULT_CPU_IMAGE\n",
198198
"\n",
199199
"cd = CondaDependencies.create(pip_packages=['azureml-sdk[automl]', 'applicationinsights', 'azureml-opendatasets'], \n",
200-
" conda_packages=['numpy', 'py-xgboost'], \n",
200+
" conda_packages=['numpy==1.16.2'], \n",
201201
" pin_sdk_version=False)\n",
202202
"#cd.add_pip_package('azureml-explain-model')\n",
203203
"conda_run_config.environment.python.conda_dependencies = cd\n",
@@ -277,7 +277,7 @@
277277
"metadata": {},
278278
"outputs": [],
279279
"source": [
280-
"data_pipeline_run.wait_for_completion()"
280+
"data_pipeline_run.wait_for_completion(show_output=False)"
281281
]
282282
},
283283
{
@@ -347,7 +347,7 @@
347347
"\n",
348348
"automl_settings = {\n",
349349
" \"iteration_timeout_minutes\": 10,\n",
350-
" \"experiment_timeout_hours\": 0.2,\n",
350+
" \"experiment_timeout_hours\": 0.25,\n",
351351
" \"n_cross_validations\": 3,\n",
352352
" \"primary_metric\": 'r2_score',\n",
353353
" \"max_concurrent_iterations\": 3,\n",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
"automl_settings = {\n",
156156
" \"n_cross_validations\": 3,\n",
157157
" \"primary_metric\": 'average_precision_score_weighted',\n",
158-
" \"experiment_timeout_hours\": 0.2, # This is a time limit for testing purposes, remove it for real use cases, this will drastically limit ability to find the best model possible\n",
158+
" \"experiment_timeout_hours\": 0.25, # This is a time limit for testing purposes, remove it for real use cases, this will drastically limit ability to find the best model possible\n",
159159
" \"verbosity\": logging.INFO,\n",
160160
" \"enable_stack_ensemble\": False\n",
161161
"}\n",

how-to-use-azureml/automated-machine-learning/regression-hardware-performance-explanation-and-featurization/auto-ml-regression-hardware-performance-explanation-and-featurization.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@
262262
"source": [
263263
"automl_settings = {\n",
264264
" \"enable_early_stopping\": True, \n",
265-
" \"experiment_timeout_hours\" : 0.2,\n",
265+
" \"experiment_timeout_hours\" : 0.25,\n",
266266
" \"max_concurrent_iterations\": 4,\n",
267267
" \"max_cores_per_iteration\": -1,\n",
268268
" \"n_cross_validations\": 5,\n",
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## Examples to get started with Azure Machine Learning SDK for R
2+
3+
Learn how to use Azure Machine Learning SDK for R for experimentation and model management.
4+
5+
As a pre-requisite, go through the [Installation](vignettes/installation.Rmd) and [Configuration](vignettes/configuration.Rmd) vignettes to first install the package and set up your Azure Machine Learning Workspace unless you are running these examples on an Azure Machine Learning compute instance. Azure Machine Learning compute instances have the Azure Machine Learning SDK pre-installed and your workspace details pre-configured.
6+
7+
8+
Samples
9+
* Deployment
10+
* [deploy-to-aci](./samples/deployment/deploy-to-aci): Deploy a model as a web service to Azure Container Instances (ACI).
11+
* [deploy-to-local](./samples/deployment/deploy-to-local): Deploy a model as a web service locally.
12+
* Training
13+
* [train-on-amlcompute](./samples/training/train-on-amlcompute): Train a model on a remote AmlCompute cluster.
14+
* [train-on-local](./samples/training/train-on-local): Train a model locally with Docker.
15+
16+
Vignettes
17+
* [deploy-to-aks](./vignettes/deploy-to-aks): Production deploy a model as a web service to Azure Kubernetes Service (AKS).
18+
* [hyperparameter-tune-with-keras](./vignettes/hyperparameter-tune-with-keras): Hyperparameter tune a Keras model using HyperDrive, Azure ML's hyperparameter tuning functionality.
19+
* [train-and-deploy-to-aci](./vignettes/train-and-deploy-to-aci): Train a caret model and deploy as a web service to Azure Container Instances (ACI).
20+
* [train-with-tensorflow](./vignettes/train-with-tensorflow): Train a deep learning TensorFlow model with Azure ML.
21+
22+
Find more information on the [official documentation site for Azure Machine Learning SDK for R](https://azure.github.io/azureml-sdk-for-r/).
23+
24+
25+
### Troubleshooting
26+
27+
- If the following error occurs when submitting an experiment using RStudio:
28+
```R
29+
Error in py_call_impl(callable, dots$args, dots$keywords) :
30+
PermissionError: [Errno 13] Permission denied
31+
```
32+
Move the files for your project into a subdirectory and reset the working directory to that directory before re-submitting.
33+
34+
In order to submit an experiment, the Azure ML SDK must create a .zip file of the project directory to send to the service. However,
35+
the SDK does not have permission to write into the .Rproj.user subdirectory that is automatically created during an RStudio
36+
session. For this reason, the recommended best practice is to isolate project files into their own directory.

0 commit comments

Comments
 (0)