From 5733b850297abd3265781619ee6081c14b9b96ba Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Wed, 3 Nov 2021 00:45:01 -0700 Subject: [PATCH] fix: performance issue in interpretability notebooks (#1238) --- notebooks/Interpretability - Explanation Dashboard.ipynb | 2 +- notebooks/Interpretability - Tabular SHAP explainer.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/notebooks/Interpretability - Explanation Dashboard.ipynb b/notebooks/Interpretability - Explanation Dashboard.ipynb index 2f045172ad..a86960cf0d 100644 --- a/notebooks/Interpretability - Explanation Dashboard.ipynb +++ b/notebooks/Interpretability - Explanation Dashboard.ipynb @@ -169,7 +169,7 @@ " model=model,\n", " targetCol=\"probability\",\n", " targetClasses=[1],\n", - " backgroundData=training.orderBy(rand()).limit(100).cache(),\n", + " backgroundData=broadcast(training.orderBy(rand()).limit(100).cache()),\n", ")\n", "\n", "shap_df = shap.transform(explain_instances)\n" diff --git a/notebooks/Interpretability - Tabular SHAP explainer.ipynb b/notebooks/Interpretability - Tabular SHAP explainer.ipynb index 8bde934744..0f72094d9c 100644 --- a/notebooks/Interpretability - Tabular SHAP explainer.ipynb +++ b/notebooks/Interpretability - Tabular SHAP explainer.ipynb @@ -165,7 +165,7 @@ " model=model,\n", " targetCol=\"probability\",\n", " targetClasses=[1],\n", - " backgroundData=training.orderBy(rand()).limit(100).cache(),\n", + " backgroundData=broadcast(training.orderBy(rand()).limit(100).cache()),\n", ")\n", "\n", "shap_df = shap.transform(explain_instances)\n"