Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
update samples from Release-117 as a part of SDK release
  • Loading branch information
amlrelsa-ms committed Dec 13, 2021
commit dd494e9cac8be6a9d098c47c54dd403d826988eb
2 changes: 1 addition & 1 deletion configuration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"source": [
"import azureml.core\n",
"\n",
"print(\"This notebook was created using version 1.36.0 of the Azure ML SDK\")\n",
"print(\"This notebook was created using version 1.37.0 of the Azure ML SDK\")\n",
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
]
},
Expand Down
2 changes: 1 addition & 1 deletion contrib/fairness/fairlearn-azureml-mitigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ dependencies:
- fairlearn>=0.6.2
- joblib
- liac-arff
- raiwidgets~=0.13.0
- raiwidgets~=0.15.0
2 changes: 1 addition & 1 deletion contrib/fairness/upload-fairness-dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ dependencies:
- fairlearn>=0.6.2
- joblib
- liac-arff
- raiwidgets~=0.13.0
- raiwidgets~=0.15.0
5 changes: 2 additions & 3 deletions how-to-use-azureml/automated-machine-learning/automl_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ dependencies:
# Currently Azure ML only supports 3.5.2 and later.
- pip==21.1.2
- python>=3.5.2,<3.8
- nb_conda
- boto3==1.15.18
- matplotlib==2.1.0
- numpy==1.18.5
Expand All @@ -22,9 +21,9 @@ dependencies:

- pip:
# Required packages for AzureML execution, history, and data preparation.
- azureml-widgets~=1.36.0
- azureml-widgets~=1.37.0
- pytorch-transformers==1.0.0
- spacy==2.1.8
- https://aka.ms/automl-resources/packages/en_core_web_sm-2.1.0.tar.gz
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.36.0/validated_win32_requirements.txt [--no-deps]
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.37.0/validated_win32_requirements.txt [--no-deps]
- arch==4.14
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ dependencies:

- pip:
# Required packages for AzureML execution, history, and data preparation.
- azureml-widgets~=1.36.0
- azureml-widgets~=1.37.0
- pytorch-transformers==1.0.0
- spacy==2.1.8
- https://aka.ms/automl-resources/packages/en_core_web_sm-2.1.0.tar.gz
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.36.0/validated_linux_requirements.txt [--no-deps]
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.37.0/validated_linux_requirements.txt [--no-deps]
- arch==4.14
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ dependencies:

- pip:
# Required packages for AzureML execution, history, and data preparation.
- azureml-widgets~=1.36.0
- azureml-widgets~=1.37.0
- pytorch-transformers==1.0.0
- spacy==2.1.8
- https://aka.ms/automl-resources/packages/en_core_web_sm-2.1.0.tar.gz
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.36.0/validated_darwin_requirements.txt [--no-deps]
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.37.0/validated_darwin_requirements.txt [--no-deps]
- arch==4.14
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"import logging\n",
"\n",
"from matplotlib import pyplot as plt\n",
Expand Down Expand Up @@ -104,7 +105,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(\"This notebook was created using version 1.36.0 of the Azure ML SDK\")\n",
"print(\"This notebook was created using version 1.37.0 of the Azure ML SDK\")\n",
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
]
},
Expand Down Expand Up @@ -410,7 +411,8 @@
"metadata": {},
"outputs": [],
"source": [
"best_run_customized, fitted_model_customized = remote_run.get_output()"
"# Retrieve the best Run object\n",
"best_run = remote_run.get_best_child()"
]
},
{
Expand All @@ -419,7 +421,7 @@
"source": [
"## Transparency\n",
"\n",
"View updated featurization summary"
"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."
]
},
{
Expand All @@ -428,36 +430,14 @@
"metadata": {},
"outputs": [],
"source": [
"custom_featurizer = fitted_model_customized.named_steps['datatransformer']\n",
"df = custom_featurizer.get_featurization_summary()\n",
"pd.DataFrame(data=df)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Set `is_user_friendly=False` to get a more detailed summary for the transforms being applied."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"df = custom_featurizer.get_featurization_summary(is_user_friendly=False)\n",
"pd.DataFrame(data=df)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"df = custom_featurizer.get_stats_feature_type_summary()\n",
"pd.DataFrame(data=df)"
"# Download the featuurization summary JSON file locally\n",
"best_run.download_file(\"outputs/featurization_summary.json\", \"featurization_summary.json\")\n",
"\n",
"# Render the JSON as a pandas DataFrame\n",
"with open(\"featurization_summary.json\", \"r\") as f:\n",
" records = json.load(f)\n",
"\n",
"pd.DataFrame.from_records(records)"
]
},
{
Expand Down Expand Up @@ -499,7 +479,7 @@
"model_explainability_run.wait_for_completion()\n",
"\n",
"# Get the best run object\n",
"best_run, fitted_model = remote_run.get_output()"
"best_run = remote_run.get_best_child()"
]
},
{
Expand Down Expand Up @@ -629,7 +609,16 @@
"\n",
"### Retrieve the Best Model\n",
"\n",
"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*."
"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."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"remote_run.get_best_child??"
]
},
{
Expand All @@ -649,7 +638,7 @@
"metadata": {},
"outputs": [],
"source": [
"best_run, fitted_model = remote_run.get_output()"
"best_run = remote_run.get_best_child()"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(\"This notebook was created using version 1.36.0 of the Azure ML SDK\")\n",
"print(\"This notebook was created using version 1.37.0 of the Azure ML SDK\")\n",
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"import logging\n",
"import os\n",
"import shutil\n",
Expand Down Expand Up @@ -96,7 +97,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(\"This notebook was created using version 1.36.0 of the Azure ML SDK\")\n",
"print(\"This notebook was created using version 1.37.0 of the Azure ML SDK\")\n",
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
]
},
Expand Down Expand Up @@ -340,8 +341,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"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",
"MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/automl_env.yml"
"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",
"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",
"MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/automl_env.yml\n"
]
},
{
Expand All @@ -350,7 +352,8 @@
"metadata": {},
"outputs": [],
"source": [
"best_run, fitted_model = automl_run.get_output()"
"# Retrieve the best Run object\n",
"best_run = automl_run.get_best_child()"
]
},
{
Expand All @@ -366,10 +369,15 @@
"metadata": {},
"outputs": [],
"source": [
"text_transformations_used = []\n",
"for column_group in fitted_model.named_steps['datatransformer'].get_featurization_summary():\n",
" text_transformations_used.extend(column_group['Transformations'])\n",
"text_transformations_used"
"# Download the featuurization summary JSON file locally\n",
"best_run.download_file(\"outputs/featurization_summary.json\", \"featurization_summary.json\")\n",
"\n",
"# Render the JSON as a pandas DataFrame\n",
"with open(\"featurization_summary.json\", \"r\") as f:\n",
" records = json.load(f)\n",
"\n",
"featurization_summary = pd.DataFrame.from_records(records)\n",
"featurization_summary['Transformations'].tolist()"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(\"This notebook was created using version 1.36.0 of the Azure ML SDK\")\n",
"print(\"This notebook was created using version 1.37.0 of the Azure ML SDK\")\n",
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(\"This notebook was created using version 1.36.0 of the Azure ML SDK\")\n",
"print(\"This notebook was created using version 1.37.0 of the Azure ML SDK\")\n",
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(\"This notebook was created using version 1.36.0 of the Azure ML SDK\")\n",
"print(\"This notebook was created using version 1.37.0 of the Azure ML SDK\")\n",
"print(\"You are currently using version\", azureml.core.VERSION, \"of the Azure ML SDK\")"
]
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading