Skip to content

Commit dd494e9

Browse files
committed
update samples from Release-117 as a part of SDK release
1 parent 352adb7 commit dd494e9

File tree

58 files changed

+2355
-253
lines changed

Some content is hidden

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

58 files changed

+2355
-253
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.36.0 of the Azure ML SDK\")\n",
106+
"print(\"This notebook was created using version 1.37.0 of the Azure ML SDK\")\n",
107107
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
108108
]
109109
},

contrib/fairness/fairlearn-azureml-mitigation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ dependencies:
66
- fairlearn>=0.6.2
77
- joblib
88
- liac-arff
9-
- raiwidgets~=0.13.0
9+
- raiwidgets~=0.15.0

contrib/fairness/upload-fairness-dashboard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ dependencies:
66
- fairlearn>=0.6.2
77
- joblib
88
- liac-arff
9-
- raiwidgets~=0.13.0
9+
- raiwidgets~=0.15.0

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ dependencies:
44
# Currently Azure ML only supports 3.5.2 and later.
55
- pip==21.1.2
66
- python>=3.5.2,<3.8
7-
- nb_conda
87
- boto3==1.15.18
98
- matplotlib==2.1.0
109
- numpy==1.18.5
@@ -22,9 +21,9 @@ dependencies:
2221

2322
- pip:
2423
# Required packages for AzureML execution, history, and data preparation.
25-
- azureml-widgets~=1.36.0
24+
- azureml-widgets~=1.37.0
2625
- pytorch-transformers==1.0.0
2726
- spacy==2.1.8
2827
- https://aka.ms/automl-resources/packages/en_core_web_sm-2.1.0.tar.gz
29-
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.36.0/validated_win32_requirements.txt [--no-deps]
28+
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.37.0/validated_win32_requirements.txt [--no-deps]
3029
- arch==4.14

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ dependencies:
2222

2323
- pip:
2424
# Required packages for AzureML execution, history, and data preparation.
25-
- azureml-widgets~=1.36.0
25+
- azureml-widgets~=1.37.0
2626
- pytorch-transformers==1.0.0
2727
- spacy==2.1.8
2828
- https://aka.ms/automl-resources/packages/en_core_web_sm-2.1.0.tar.gz
29-
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.36.0/validated_linux_requirements.txt [--no-deps]
29+
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.37.0/validated_linux_requirements.txt [--no-deps]
3030
- arch==4.14

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ dependencies:
2323

2424
- pip:
2525
# Required packages for AzureML execution, history, and data preparation.
26-
- azureml-widgets~=1.36.0
26+
- azureml-widgets~=1.37.0
2727
- pytorch-transformers==1.0.0
2828
- spacy==2.1.8
2929
- https://aka.ms/automl-resources/packages/en_core_web_sm-2.1.0.tar.gz
30-
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.36.0/validated_darwin_requirements.txt [--no-deps]
30+
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.37.0/validated_darwin_requirements.txt [--no-deps]
3131
- arch==4.14

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

Lines changed: 25 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"metadata": {},
7878
"outputs": [],
7979
"source": [
80+
"import json\n",
8081
"import logging\n",
8182
"\n",
8283
"from matplotlib import pyplot as plt\n",
@@ -104,7 +105,7 @@
104105
"metadata": {},
105106
"outputs": [],
106107
"source": [
107-
"print(\"This notebook was created using version 1.36.0 of the Azure ML SDK\")\n",
108+
"print(\"This notebook was created using version 1.37.0 of the Azure ML SDK\")\n",
108109
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
109110
]
110111
},
@@ -410,7 +411,8 @@
410411
"metadata": {},
411412
"outputs": [],
412413
"source": [
413-
"best_run_customized, fitted_model_customized = remote_run.get_output()"
414+
"# Retrieve the best Run object\n",
415+
"best_run = remote_run.get_best_child()"
414416
]
415417
},
416418
{
@@ -419,7 +421,7 @@
419421
"source": [
420422
"## Transparency\n",
421423
"\n",
422-
"View updated featurization summary"
424+
"View featurization summary for the best model - to study how different features were transformed. This is stored as a JSON file in the outputs directory for the run."
423425
]
424426
},
425427
{
@@ -428,36 +430,14 @@
428430
"metadata": {},
429431
"outputs": [],
430432
"source": [
431-
"custom_featurizer = fitted_model_customized.named_steps['datatransformer']\n",
432-
"df = custom_featurizer.get_featurization_summary()\n",
433-
"pd.DataFrame(data=df)"
434-
]
435-
},
436-
{
437-
"cell_type": "markdown",
438-
"metadata": {},
439-
"source": [
440-
"Set `is_user_friendly=False` to get a more detailed summary for the transforms being applied."
441-
]
442-
},
443-
{
444-
"cell_type": "code",
445-
"execution_count": null,
446-
"metadata": {},
447-
"outputs": [],
448-
"source": [
449-
"df = custom_featurizer.get_featurization_summary(is_user_friendly=False)\n",
450-
"pd.DataFrame(data=df)"
451-
]
452-
},
453-
{
454-
"cell_type": "code",
455-
"execution_count": null,
456-
"metadata": {},
457-
"outputs": [],
458-
"source": [
459-
"df = custom_featurizer.get_stats_feature_type_summary()\n",
460-
"pd.DataFrame(data=df)"
433+
"# Download the featuurization summary JSON file locally\n",
434+
"best_run.download_file(\"outputs/featurization_summary.json\", \"featurization_summary.json\")\n",
435+
"\n",
436+
"# Render the JSON as a pandas DataFrame\n",
437+
"with open(\"featurization_summary.json\", \"r\") as f:\n",
438+
" records = json.load(f)\n",
439+
"\n",
440+
"pd.DataFrame.from_records(records)"
461441
]
462442
},
463443
{
@@ -499,7 +479,7 @@
499479
"model_explainability_run.wait_for_completion()\n",
500480
"\n",
501481
"# Get the best run object\n",
502-
"best_run, fitted_model = remote_run.get_output()"
482+
"best_run = remote_run.get_best_child()"
503483
]
504484
},
505485
{
@@ -629,7 +609,16 @@
629609
"\n",
630610
"### Retrieve the Best Model\n",
631611
"\n",
632-
"Below we select the best pipeline from our iterations. The `get_output` method returns the best run and the fitted model. Overloads on `get_output` allow you to retrieve the best run and fitted model for *any* logged metric or for a particular *iteration*."
612+
"Below we select the best pipeline from our iterations. The `get_best_child` method returns the Run object for the best model based on the default primary metric. There are additional flags that can be passed to the method if we want to retrieve the best Run based on any of the other supported metrics, or if we are just interested in the best run among the ONNX compatible runs. As always, you can execute `remote_run.get_best_child??` in a new cell to view the source or docs for the function."
613+
]
614+
},
615+
{
616+
"cell_type": "code",
617+
"execution_count": null,
618+
"metadata": {},
619+
"outputs": [],
620+
"source": [
621+
"remote_run.get_best_child??"
633622
]
634623
},
635624
{
@@ -649,7 +638,7 @@
649638
"metadata": {},
650639
"outputs": [],
651640
"source": [
652-
"best_run, fitted_model = remote_run.get_output()"
641+
"best_run = remote_run.get_best_child()"
653642
]
654643
},
655644
{

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
@@ -93,7 +93,7 @@
9393
"metadata": {},
9494
"outputs": [],
9595
"source": [
96-
"print(\"This notebook was created using version 1.36.0 of the Azure ML SDK\")\n",
96+
"print(\"This notebook was created using version 1.37.0 of the Azure ML SDK\")\n",
9797
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
9898
]
9999
},

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"metadata": {},
6464
"outputs": [],
6565
"source": [
66+
"import json\n",
6667
"import logging\n",
6768
"import os\n",
6869
"import shutil\n",
@@ -96,7 +97,7 @@
9697
"metadata": {},
9798
"outputs": [],
9899
"source": [
99-
"print(\"This notebook was created using version 1.36.0 of the Azure ML SDK\")\n",
100+
"print(\"This notebook was created using version 1.37.0 of the Azure ML SDK\")\n",
100101
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
101102
]
102103
},
@@ -340,8 +341,9 @@
340341
"cell_type": "markdown",
341342
"metadata": {},
342343
"source": [
343-
"You can test the model locally to get a feel of the input/output. 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:\n",
344-
"MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/automl_env.yml"
344+
"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",
345+
"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:\n",
346+
"MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/automl_env.yml\n"
345347
]
346348
},
347349
{
@@ -350,7 +352,8 @@
350352
"metadata": {},
351353
"outputs": [],
352354
"source": [
353-
"best_run, fitted_model = automl_run.get_output()"
355+
"# Retrieve the best Run object\n",
356+
"best_run = automl_run.get_best_child()"
354357
]
355358
},
356359
{
@@ -366,10 +369,15 @@
366369
"metadata": {},
367370
"outputs": [],
368371
"source": [
369-
"text_transformations_used = []\n",
370-
"for column_group in fitted_model.named_steps['datatransformer'].get_featurization_summary():\n",
371-
" text_transformations_used.extend(column_group['Transformations'])\n",
372-
"text_transformations_used"
372+
"# Download the featuurization summary JSON file locally\n",
373+
"best_run.download_file(\"outputs/featurization_summary.json\", \"featurization_summary.json\")\n",
374+
"\n",
375+
"# Render the JSON as a pandas DataFrame\n",
376+
"with open(\"featurization_summary.json\", \"r\") as f:\n",
377+
" records = json.load(f)\n",
378+
"\n",
379+
"featurization_summary = pd.DataFrame.from_records(records)\n",
380+
"featurization_summary['Transformations'].tolist()"
373381
]
374382
},
375383
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"metadata": {},
8282
"outputs": [],
8383
"source": [
84-
"print(\"This notebook was created using version 1.36.0 of the Azure ML SDK\")\n",
84+
"print(\"This notebook was created using version 1.37.0 of the Azure ML SDK\")\n",
8585
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
8686
]
8787
},

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

Lines changed: 1 addition & 1 deletion
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.36.0 of the Azure ML SDK\")\n",
95+
"print(\"This notebook was created using version 1.37.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

Lines changed: 1 addition & 1 deletion
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.36.0 of the Azure ML SDK\")\n",
94+
"print(\"This notebook was created using version 1.37.0 of the Azure ML SDK\")\n",
9595
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
9696
]
9797
},

0 commit comments

Comments
 (0)