Skip to content

Commit 8d3f5ad

Browse files
committed
update samples from Release-147 as a part of SDK release
1 parent cd3394e commit 8d3f5ad

File tree

22 files changed

+296
-33
lines changed

22 files changed

+296
-33
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.42.0 of the Azure ML SDK\")\n",
106+
"print(\"This notebook was created using version 1.43.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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ dependencies:
66
- fairlearn>=0.6.2
77
- joblib
88
- liac-arff
9-
- raiwidgets~=0.18.1
9+
- raiwidgets~=0.19.0
1010
- itsdangerous==2.0.1
1111
- markupsafe<2.1.0
12+
- protobuf==3.20.0

contrib/fairness/upload-fairness-dashboard.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ dependencies:
66
- fairlearn>=0.6.2
77
- joblib
88
- liac-arff
9-
- raiwidgets~=0.18.1
9+
- raiwidgets~=0.19.0
1010
- itsdangerous==2.0.1
1111
- markupsafe<2.1.0
12+
- protobuf==3.20.0

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
- pytorch::pytorch=1.4.0
1414
- conda-forge::fbprophet==0.7.1
1515
- cudatoolkit=10.1.243
16-
- scipy==1.5.2
16+
- scipy==1.5.3
1717
- notebook
1818
- pywin32==227
1919
- PySocks==1.7.1
@@ -22,10 +22,10 @@ dependencies:
2222

2323
- pip:
2424
# Required packages for AzureML execution, history, and data preparation.
25-
- azureml-widgets~=1.42.0
25+
- azureml-widgets~=1.43.0
2626
- pytorch-transformers==1.0.0
2727
- spacy==2.2.4
2828
- pystan==2.19.1.1
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.42.0/validated_win32_requirements.txt [--no-deps]
30+
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.43.0/validated_win32_requirements.txt [--no-deps]
3131
- arch==4.14

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies:
1414
- numpy==1.19.5
1515
- cython==0.29.14
1616
- urllib3==1.26.7
17-
- scipy>=1.4.1,<=1.5.2
17+
- scipy>=1.4.1,<=1.5.3
1818
- scikit-learn==0.22.1
1919
- py-xgboost<=1.3.3
2020
- holidays==0.10.3
@@ -24,10 +24,10 @@ dependencies:
2424

2525
- pip:
2626
# Required packages for AzureML execution, history, and data preparation.
27-
- azureml-widgets~=1.42.0
27+
- azureml-widgets~=1.43.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.42.0/validated_linux_requirements.txt [--no-deps]
32+
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.43.0/validated_linux_requirements.txt [--no-deps]
3333
- arch==4.14

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies:
1515
- numpy==1.19.5
1616
- cython==0.29.14
1717
- urllib3==1.26.7
18-
- scipy>=1.4.1,<=1.5.2
18+
- scipy>=1.4.1,<=1.5.3
1919
- scikit-learn==0.22.1
2020
- py-xgboost<=1.3.3
2121
- holidays==0.10.3
@@ -25,10 +25,10 @@ dependencies:
2525

2626
- pip:
2727
# Required packages for AzureML execution, history, and data preparation.
28-
- azureml-widgets~=1.42.0
28+
- azureml-widgets~=1.43.0
2929
- pytorch-transformers==1.0.0
3030
- spacy==2.2.4
3131
- pystan==2.19.1.1
3232
- https://aka.ms/automl-resources/packages/en_core_web_sm-2.1.0.tar.gz
33-
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.42.0/validated_darwin_requirements.txt [--no-deps]
33+
- -r https://automlsdkdataresources.blob.core.windows.net/validated-requirements/1.43.0/validated_darwin_requirements.txt [--no-deps]
3434
- arch==4.14

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.42.0 of the Azure ML SDK\")\n",
95+
"print(\"This notebook was created using version 1.43.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.42.0 of the Azure ML SDK\")\n",
94+
"print(\"This notebook was created using version 1.43.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/explain-model/azure-integration/gpu-explanation/gpu_tree_explainer.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Licensed under the MIT license.
33

44
from azureml.core.run import Run
5+
from azureml.interpret import ExplanationClient
6+
from interpret_community.adapter import ExplanationAdapter
57
import joblib
68
import os
79
import shap
@@ -11,9 +13,11 @@
1113
os.makedirs(OUTPUT_DIR, exist_ok=True)
1214

1315
run = Run.get_context()
16+
client = ExplanationClient.from_run(run)
1417

1518
# get a dataset on income prediction
1619
X, y = shap.datasets.adult()
20+
features = X.columns.values
1721

1822
# train an XGBoost model (but any other tree model type should work)
1923
model = xgboost.XGBClassifier()
@@ -26,6 +30,12 @@
2630
print("computed shap values:")
2731
print(shap_values)
2832

33+
# Use the explanation adapter to convert the importances into an interpret-community
34+
# style explanation which can be uploaded to AzureML or visualized in the
35+
# ExplanationDashboard widget
36+
adapter = ExplanationAdapter(features, classification=True)
37+
global_explanation = adapter.create_global(shap_values.values, X_shap, expected_values=shap_values.base_values)
38+
2939
# write X_shap out as a pickle file for later visualization
3040
x_shap_pkl = 'x_shap.pkl'
3141
with open(x_shap_pkl, 'wb') as file:
@@ -42,3 +52,8 @@
4252
run.upload_file('xgboost_model.pkl', os.path.join('./outputs/', model_file_name))
4353
original_model = run.register_model(model_name='xgboost_with_gpu_tree_explainer',
4454
model_path='xgboost_model.pkl')
55+
56+
# Uploading model explanation data for storage or visualization in webUX
57+
# The explanation can then be downloaded on any compute
58+
comment = 'Global explanation on classification model trained on adult census income dataset'
59+
client.upload_model_explanation(global_explanation, comment=comment, model_id=original_model.id)

0 commit comments

Comments
 (0)