Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Databricks Render multiple visualizations #88

Open
jakedubb opened this issue Oct 24, 2019 · 13 comments
Open

Databricks Render multiple visualizations #88

jakedubb opened this issue Oct 24, 2019 · 13 comments

Comments

@jakedubb
Copy link

When rendering visualizations using show() in databricks I am only able to render 1 visualization at a time. All subsequent attempts display this error:

Uncaught TypeError: Cannot read property 'RenderApp' of undefined

Can we worked around by restarting python using following command:
dbutils.library.restartPython()

and rerunning notebook with a different visualization. But essentially after the first visualization renders all others fail.

@jakedubb
Copy link
Author

As a followup, is there any function for extracting FeatureValueExplanation directly to dataframes? This would partially solve my issue in Databricks

@interpret-ml
Copy link
Collaborator

Hi @jakedubb,

Thanks for reporting this! We are actively looking into this, and will report back once we have some better answers.

To answer your follow up question:
"is there any function for extracting FeatureValueExplanation directly to dataframes?"

You won't be able to extract things directly to dataframes, but you can call .data() on any Explanation to extract the underlying data. The .data() method also takes in a "key" argument, ex: explanation.data(key=0) to pull out the specific data for an individual visualization (like an individual EBM graph). The data() method returns a dictionary that should be fairly easy to massage into a DataFrame of your choosing.

Alternatively, you can also directly call explanation.visualize(key=0) to directly produce a graph. Hopefully the .data() and .visualize() are sufficient temporary workarounds as we look into the databricks issue.

Thanks,
-InterpretML Team

@hanman2016
Copy link

hanman2016 commented Mar 4, 2020

The below error received when executed following code in Azure Databricks.
Please suggest action item.

from interpret.blackbox import LimeTabular
from interpret import show

lime = LimeTabular(predict_fn=blackbox_model.predict_proba, data=X_train, random_state=1)
lime_local = lime.explain_local(X_test[:5], y_test[:5], name='LIME')
show(lime_local)

=============================================
Uncaught TypeError: Cannot read property 'RenderApp' of undefined

@akshararama
Copy link

Was this ever resolved? I am still getting that same Uncaught TypeError: Cannot read property 'RenderApp' of undefined when I try to have multiple visualization in the same databricks notebook. The visualize workaround is hard to use since I have a lot of different variables to visualize.

@jakeatmsft
Copy link

@akshararama - I am able to render multiple ExplanationDashboard widgets in the same notebook.

DB cluster version - 7.0 ML
Libraries:

azureml-sdk[explain,interpret,databricks]
PyPI

fairlearn
PyPI

flask_cors
PyPI

interpret-community[visualization]
PyPI

sklearn_pandas
PyPI

@SoulEvill
Copy link

SoulEvill commented Jul 14, 2020

I am having the same issues, still getting the error: Uncaught TypeError: Cannot read property 'RenderApp' of undefined

I tried to install the same library as shown above and same runtime 7.0 ML. only difference is that I am using AWS not Azure. but I am still only able to render 1 visualization at once by use visualize(key=n).

Sometime I will get different error:

Error: RangeError: Maximum call stack size exceeded
at RegExp.exec ()
at new m.fn.init (https://.cloud.databricks.com/js/main.7cdf21c6.js:1:6620137)
at m (https://
.cloud.databricks.com/js/main.7cdf21c6.js:1:6596167)
at r.updateResultDiv (https://.cloud.databricks.com/js/main.7cdf21c6.js:1:3469902)
at render0 (https://
.cloud.databricks.com/js/main.7cdf21c6.js:1:3460196)
at render (https://.cloud.databricks.com/js/main.7cdf21c6.js:1:3458519)
at r.createWidgetView (https://
.cloud.databricks.com/js/main.7cdf21c6.js:1:3495160)
at r.addWidgetView (https://.cloud.databricks.com/js/main.7cdf21c6.js:1:3495325)
at render (https://
.cloud.databricks.com/js/main.7cdf21c6.js:1:3492915)
at t.renderDashboardView (https://******.cloud.databricks.com/js/main.7cdf21c6.js:1:2157749)

Can you take a look? Much appreciated!

@interpret-ml
Copy link
Collaborator

We've made some improvements in our Databricks support, which should hopefully resolve these issues. We'll leave this issue open for now in case anyone still has problems.

-InterpretML

@bubu-chikvinidze
Copy link

I am having the same issue trying to render html with displayHTML function in databricks

@hommayushi3
Copy link

I am also running into this same issue with multiple visualizations in Databricks with the most recent interpretml version.

@djoconnell34
Copy link

Hello, has anyone been able to solve the initial issue, of only one show() visualization being rendered in databricks? I have done a good amount of troubleshooting and cannot solve the issue. I have tried many versions of interpret and other packages. Thanks

@paulbkoch paulbkoch reopened this Sep 21, 2023
@paulbkoch paulbkoch mentioned this issue Jun 7, 2023
@djoconnell34
Copy link

Hello! Thanks @paulbkoch and @interpret-ml for opening this ticket back up! I just solved my issue though. For some reason 'InlineProvider' did not know the environment. We just switched to the newer Databricks Architecture (E2) and maybe our security settings messed it up. I have had to specify our environment as 'databricks' for some other packages since switching to E2, so I don't think it was an Interpret issue.

Error Message after using the show() function once and trying to use show() again.
Uncaught TypeError: Cannot read property 'RenderApp' of undefined

Hope the following helps if anyone else runs into the same problem. Create an instance of the 'InlineProvider', change the instance's method 'detected_envs' to 'databricks' and then 'set_visualize_provider' with that instance. See below!

from interpret import set_visualize_provider
from interpret.provider import InlineProvider
in_pro= InlineProvider()
in_pro.detected_envs = 'databricks'
set_visualize_provider(in_pro)

@paulbkoch
Copy link
Collaborator

Thanks @djoconnell34 for the update. I'll leave the issue in our backlog to fix the auto-detection. Good to hear it works with the right settings though.

@jasongrout-db
Copy link

@paulbkoch - I work at Databricks on the notebook frontend, and this error came on our radar. Please let us know if you have any questions about getting interpret to work in Databricks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests