Skip to content

ModuleNotFoundError: No module named 'azureml.explain' #172

Closed
@Zhangsz95

Description

@Zhangsz95

code:
from azureml.train.automl.automlexplainer import explain_model
shap_values,expected_values,overall_summary,overall_imp,per_class_summary,per_class_imp=explain_model(fitted_model, x_train, x_test)
#Overall feature importance
print(overall_imp)
print(overall_summary)
#Class-level feature importance
print(per_class_imp)
print(per_class_summary)

result:

ModuleNotFoundError Traceback (most recent call last)
<ipython-input-41-fc557da69821> in <module>
2 from azureml.train.automl.automlexplainer import explain_model
3
----> 4 shap_values,expected_values,overall_summary,overall_imp,per_class_summary,per_class_imp=explain_model(fitted_model, x_train, x_test)
5 #Overall feature importance
6 print(overall_imp)

~/anaconda3_501/lib/python3.6/site-packages/azureml/train/automl/automlexplainer.py in explain_model(fitted_model, X_train, X_test, best_run, features, **kwargs)
73 return _convert_explanation(explanation)
74 except ImportError as import_error:
---> 75 raise import_error
76
77

~/anaconda3_501/lib/python3.6/site-packages/azureml/train/automl/automlexplainer.py in explain_model(fitted_model, X_train, X_test, best_run, features, **kwargs)
41
42 try:
---> 43 from azureml.explain.model._internal import TabularExplainer
44
45 # Transform the dataset for datatransformer and laggingtransformer only

ModuleNotFoundError: No module named 'azureml.explain'


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions