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

evalml plots don't show up in Jupyter Lab #1040

Closed
freddyaboulton opened this issue Aug 11, 2020 · 8 comments · Fixed by #1108
Closed

evalml plots don't show up in Jupyter Lab #1040

freddyaboulton opened this issue Aug 11, 2020 · 8 comments · Fixed by #1108
Assignees
Labels
bug Issues tracking problems with existing features. good first issue Issues which would be a good starting point for new hires.

Comments

@freddyaboulton
Copy link
Contributor

I was testing out Jupyter Lab this morning and I noticed that our plots don't show up here. This is a documented issue with how plotly and jupyter lab interact.

I had to install the jupyter lab plotly extension in order to get the plots to show up. This requires node to be installed which is annoying.

Maybe the solution is to just add a section to the FAQ that points users to the plotly getting started guide and suggest they use jupyter notebook if all else fails?

Before installing plotly extension

jupyterlab_plot_no_show

After installing plotly extension

jupyterlab_plot_show

@freddyaboulton freddyaboulton added the bug Issues tracking problems with existing features. label Aug 11, 2020
@dsherry
Copy link
Contributor

dsherry commented Aug 11, 2020

@freddyaboulton thanks for filing!

Yes, we should update our docs to mention that our graph methods (graph_feature_importance etc.) require plotly, and include instructions for use of those methods with jupyter notebooks and also with jupyter lab.

I run a jupyter notebook server locally, but I don't run jupyter lab. I don't recall ever having to install a plotly extension. Any idea why that is?

Another thing I think we should do is to have those methods warn to stdout if they can't show a plot.

@dsherry dsherry added this to the September 2020 milestone Aug 11, 2020
@freddyaboulton
Copy link
Contributor Author

@dsherry To render plotly plots in a jupyter notebook you just need ipywidgets (which is listed as a non-core dependency in requirements.txt). I don't know why jupyter lab requires more steps to work well with plotly.

@freddyaboulton
Copy link
Contributor Author

I like the idea of warning to stdout when they can't display too!

@dsherry
Copy link
Contributor

dsherry commented Aug 12, 2020

@freddyaboulton got it. Then I think the fix here would be to a) update the Model Understanding docs to mention ipywidgets, and b) raise a warning when you call a graph method but ipywidgets isn't installed.

@dsherry dsherry added the good first issue Issues which would be a good starting point for new hires. label Aug 12, 2020
@bchen1116 bchen1116 self-assigned this Aug 20, 2020
@dsherry
Copy link
Contributor

dsherry commented Aug 26, 2020

@bchen1116 should this be "In Progress"?

@dsherry
Copy link
Contributor

dsherry commented Aug 26, 2020

@bchen1116 found that even if you pip-install jupyter and ipywidgets, that's not enough to render the plotly plots in jupyter notebooks. The plotly doc asks people to install some other jupyter package:

# JupyterLab renderer support
jupyter labextension install jupyterlab-plotly@4.9.0

# OPTIONAL: Jupyter widgets extension
jupyter labextension install @jupyter-widgets/jupyterlab-manager plotlywidget@4.9.0

Next steps

  • @bchen1116 confirm that installing the packages means that plots now show up in jupyter notebooks
  • If that works: find a way to detect if those packages are installed, from python. If we can, we can issue a warning.
  • Either way we should update docs to recommend this command.

@bchen1116
Copy link
Contributor

@dsherry

  • Installing the packages results in the plots appearing in jupyter lab. I've updated model_understanding.ipynb to reflect that this package is required for jupyter lab.
  • I wasn't able to find a way to use python to determine whether or not jupyterlab-plotly@4.9.0 was installed in the running notebook. I can determine if the code is running in Jupyter lab/notebook, but I don't think that will be useful for this purpose, since we can't detect whether the proper npm package is installed.

@dsherry
Copy link
Contributor

dsherry commented Aug 26, 2020

@bchen1116 makes sense. We should definitely include a link to the plotly docs you sent to me earlier, because they describe the problem pretty well.

They don't explain why, but they only list needing extra stuff for jupyter lab and not for jupyter notebooks--I was confused because I usually just run jupyter notebooks and have never had this problem. So, we should highlight that this problem appears to only be for jupyter lab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues tracking problems with existing features. good first issue Issues which would be a good starting point for new hires.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants