我们正在尝试使用 Azure 机器学习来解释模型,方法是使用 Azure ML 可解释性库,即azureml-interpret 和azureml-sdk[explain]。我们的模型是来自 sklearn.ensemble 的 RandomForestRegressor。
import lightgbm
from interpret.ext.blackbox import PFIExplainer
#from interpret.ext.glassbox import DecisionTreeExplainableModel
from azureml.contrib.interpret.explanation.explanation_client import ExplanationClient
model = train_model(X_train_df,y_train_df)
explainer = PFIExplainer(model, features = feature_names)
global_explanation = explainer.explain_global(X_test_df[0:50],true_labels=y_test_df[0:50])
explain_client = ExplanationClient.from_run(run)
explain_client.upload_model_explanation(global_explanation)
我们收到以下错误
Traceback (most recent call last):
File "training/train.py", line 83, in <module>
explain_client.upload_model_explanation(global_explanation)
File "/azureml-envs/azureml_d5d57a45ca9af991b8408524822c201f/lib/python3.6/site-packages/azureml/interpret/_internal/explanation_client.py", line 793, in upload_model_explanation
asset_type=History.ASSET_TYPE
TypeError: create_asset() got an unexpected keyword argument 'asset_type'
我们已经尝试过 - TabularExplainer、MimicExplainer(with DecisionTreeExplainableModel),但它们都导致相同的错误。