<?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: Statsmodel OLS.fit generates &amp;quot;Error displaying widget: undefined&amp;quot; in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/statsmodel-ols-fit-generates-quot-error-displaying-widget/m-p/108775#M3945</link>
    <description>&lt;P&gt;Awesome, which DBR were you using before?&lt;/P&gt;</description>
    <pubDate>Tue, 04 Feb 2025 12:38:57 GMT</pubDate>
    <dc:creator>Alberto_Umana</dc:creator>
    <dc:date>2025-02-04T12:38:57Z</dc:date>
    <item>
      <title>Statsmodel OLS.fit generates "Error displaying widget: undefined"</title>
      <link>https://community.databricks.com/t5/machine-learning/statsmodel-ols-fit-generates-quot-error-displaying-widget/m-p/107979#M3935</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am running some code which fits a linear model via Statsmodel. Everytime I run the .fit function it generates the error:&amp;nbsp;"Error displaying widget: undefined".&lt;/P&gt;&lt;P&gt;I can reproduce the error via the simple code below.&lt;/P&gt;&lt;P&gt;I am not sure what is causing this issue and I cannot find any similar issues online. Is anybody aware of the issue causing this error?&lt;/P&gt;&lt;P&gt;Node type: Standard_DS3_v2&lt;/P&gt;&lt;P&gt;Databricks runtime version: 15.1 ML&lt;/P&gt;&lt;P&gt;Statsmodel version:&amp;nbsp;&lt;SPAN&gt;0.14.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; statsmodels.api &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt; sm&lt;/SPAN&gt;&lt;/DIV&gt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lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JU1_0-1738313760137.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/14477i5BA18D4707D2D0D5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JU1_0-1738313760137.png" alt="JU1_0-1738313760137.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 31 Jan 2025 08:58:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/statsmodel-ols-fit-generates-quot-error-displaying-widget/m-p/107979#M3935</guid>
      <dc:creator>JU1</dc:creator>
      <dc:date>2025-01-31T08:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Statsmodel OLS.fit generates "Error displaying widget: undefined"</title>
      <link>https://community.databricks.com/t5/machine-learning/statsmodel-ols-fit-generates-quot-error-displaying-widget/m-p/108600#M3940</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/147091"&gt;@JU1&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;The issue is likely related to an issue with the ipywidgets library, which is used for rendering interactive widgets in Jupyter notebooks. This issue has been observed in compatibility problems between different versions of ipywidgets and other libraries.&lt;/P&gt;
&lt;P&gt;Can you run this command and send the output?&lt;/P&gt;
&lt;P&gt;import ipywidgets as widgets&lt;BR /&gt;print(widgets.__version__)&lt;/P&gt;
&lt;P&gt;Also can you try on another DBR version like 14.3&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2025 15:02:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/statsmodel-ols-fit-generates-quot-error-displaying-widget/m-p/108600#M3940</guid>
      <dc:creator>Alberto_Umana</dc:creator>
      <dc:date>2025-02-03T15:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Statsmodel OLS.fit generates "Error displaying widget: undefined"</title>
      <link>https://community.databricks.com/t5/machine-learning/statsmodel-ols-fit-generates-quot-error-displaying-widget/m-p/108774#M3944</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It was indeed the DBR which caused the issue. I changed it to 16.1 and the widgets now load.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2025 12:35:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/statsmodel-ols-fit-generates-quot-error-displaying-widget/m-p/108774#M3944</guid>
      <dc:creator>JU1</dc:creator>
      <dc:date>2025-02-04T12:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Statsmodel OLS.fit generates "Error displaying widget: undefined"</title>
      <link>https://community.databricks.com/t5/machine-learning/statsmodel-ols-fit-generates-quot-error-displaying-widget/m-p/108775#M3945</link>
      <description>&lt;P&gt;Awesome, which DBR were you using before?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2025 12:38:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/statsmodel-ols-fit-generates-quot-error-displaying-widget/m-p/108775#M3945</guid>
      <dc:creator>Alberto_Umana</dc:creator>
      <dc:date>2025-02-04T12:38:57Z</dc:date>
    </item>
  </channel>
</rss>

