<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to display shap waterfall plot in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-display-shap-waterfall-plot/m-p/49299#M28521</link>
    <description>&lt;P&gt;Thank you for the swift response.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made a minimal example and it does work as you said. However when I try with my own model it does not work, the only output is&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;Figure size 576x468 with 3 Axes&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I tried to save the figure as a file and then I do get a plot, but it does look a little broken.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;p = shap.plots.waterfall(shap_values[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;],show=&lt;/SPAN&gt;&lt;SPAN&gt;False&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;p.savefig(&lt;/SPAN&gt;&lt;SPAN&gt;"plot.png"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;My guess is that the plot shap outputs for my shap_values is broken,too large or has some other problem so databricks fails to render it.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 16 Oct 2023 11:56:36 GMT</pubDate>
    <dc:creator>invalidargument</dc:creator>
    <dc:date>2023-10-16T11:56:36Z</dc:date>
    <item>
      <title>How to display shap waterfall plot</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-display-shap-waterfall-plot/m-p/49138#M28486</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have managed to display force plot for a single observation using the advice from this thread:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.databricks.com/t5/data-engineering/how-to-display-shap-plots/td-p/28315" target="_blank"&gt;Solved: How to display SHAP plots? - Databricks - 28315&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But is there anyway to display the newer "waterfall"-plot&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://shap.readthedocs.io/en/latest/generated/shap.plots.waterfall.html" target="_blank"&gt;shap.plots.waterfall — SHAP latest documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;When running&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;shap.plots.waterfall(shap_values[0])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I get output like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Out[105]: &amp;lt;Figure size 576x468 with 3 Axes&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have tried calling:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;plt.show()&lt;/LI&gt;&lt;LI&gt;display()&lt;/LI&gt;&lt;LI&gt;display(plt.gcf())&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;But same result. Any advice? Is it supposed to work?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 14:00:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-display-shap-waterfall-plot/m-p/49138#M28486</guid>
      <dc:creator>invalidargument</dc:creator>
      <dc:date>2023-10-13T14:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to display shap waterfall plot</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-display-shap-waterfall-plot/m-p/49299#M28521</link>
      <description>&lt;P&gt;Thank you for the swift response.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made a minimal example and it does work as you said. However when I try with my own model it does not work, the only output is&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;Figure size 576x468 with 3 Axes&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I tried to save the figure as a file and then I do get a plot, but it does look a little broken.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;p = shap.plots.waterfall(shap_values[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;],show=&lt;/SPAN&gt;&lt;SPAN&gt;False&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;p.savefig(&lt;/SPAN&gt;&lt;SPAN&gt;"plot.png"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;My guess is that the plot shap outputs for my shap_values is broken,too large or has some other problem so databricks fails to render it.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 16 Oct 2023 11:56:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-display-shap-waterfall-plot/m-p/49299#M28521</guid>
      <dc:creator>invalidargument</dc:creator>
      <dc:date>2023-10-16T11:56:36Z</dc:date>
    </item>
  </channel>
</rss>

