實際產出——磚筆記本
預期的輸出——Jupyter筆記本
可複製的代碼示例
# pip安裝explainerdashboard
從sklearn。整體進口RandomForestClassifier
從進口ClassifierExplainer explainerdashboard explainerdashboard
從explainerdashboard。數據集進口titanic_survive feature_descriptions
X_train、y_train X_test y_test = titanic_survive ()
模型= RandomForestClassifier (n_estimators = 50, max_depth = 10)。fit (X_train y_train)
講解員= ClassifierExplainer(模型、X_test y_test,
貓=[“甲板”、“開始”),
= feature_descriptions描述,
標簽=(“沒有幸存下來”,“幸存”))
ExplainerDashboard(講解員,模式=“內聯”,
重要性= False,
model_summary = False,
= True的貢獻,
尼塔= False,
shap_dependence = False,
shap_interaction = False,
decision_trees = False) .run ()