Spaces:
Sleeping
Sleeping
include shap_plot_text and shap_waterfall methods
Browse files- src/datashap/DataSHAP.py +10 -1
src/datashap/DataSHAP.py
CHANGED
|
@@ -147,4 +147,13 @@ class DataSHAP:
|
|
| 147 |
|
| 148 |
def get_plot_rank(self, max_display=11):
|
| 149 |
self.plot_bar, self.axis, self.rank = self.plot_rank(max_display=max_display)
|
| 150 |
-
return self.plot_bar, self.axis, self.rank
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
|
| 148 |
def get_plot_rank(self, max_display=11):
|
| 149 |
self.plot_bar, self.axis, self.rank = self.plot_rank(max_display=max_display)
|
| 150 |
+
return self.plot_bar, self.axis, self.rank
|
| 151 |
+
|
| 152 |
+
def shap_plot_text(self, num, tag):
|
| 153 |
+
return shap.plots.text(self.shap_value[num, :, tag], display = False)
|
| 154 |
+
|
| 155 |
+
def shap_waterfall(self, num, tag, max_display):
|
| 156 |
+
plot_waterfall, ax = plt.subplots()
|
| 157 |
+
shap.plots.waterfall(self.shap_value[num, :, tag], show=False, max_display=max_display)
|
| 158 |
+
plt.close()
|
| 159 |
+
return plot_waterfall
|