實際產出——磚筆記本
預期的輸出——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 ()
請做以下調整代碼然後你將能夠得到ExplainerDashboard。
1)在磚集群的設置環境變量
例如:
DASH_REQUEST_PATHNAME_PREFIX = / driver-proxy / o / 4080082044610008/1004 - 091920 cxkidhkx / 8888
工作區ID: 4080082044610008
Cluster-ID: 1004 - 091920 - cxkidhkx
端口號:8888
2)安裝explainerdashboard圖書館
% pip安裝explainerdashboard
3)驗證“衝刺”的示例代碼
從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 (8888)
4)儀表板URL
https://xxxxxxxx.m.eheci.com/driver proxy/o/4080082044610008/1004 - 091920 cxkidhkx/8888