SelfExplainML / PiML-Toolbox

PiML (Python Interpretable Machine Learning) toolbox for model development & diagnostics
https://selfexplainml.github.io/PiML-Toolbox
Apache License 2.0
912 stars 109 forks source link

VSCode cannot display some graphs #31

Closed faradawn closed 1 year ago

faradawn commented 1 year ago

Hi,

The graphs for exp.eda() and the window for exp.model_train() displayed fine.

Screenshot 2023-03-21 at 10 34 52 PM

However, exp.model_interpret() and exp.mode l_explain()'s results do not show in the jupyter notebook.

Screenshot 2023-03-21 at 10 32 39 PM

Tried many times, such as restarting the kernel, which didn't solve the problem.

Is there a way to use commands to select the model that display the graphs? I think that after selecting an item, the HTML needs to be re-rendered, and the second re-rendered seemed to fail.

Below are my version: MacOS: 13.2.1 VSCode: 1.76.2 (Universal) ipywidgets: 8.0.5 ipykernel: 6.17.1 ipython: 8.11.0

In Colab, all the GUI worked fine. But would like to run the notebook locally.

Appreciate any help!

CnBDM-Su commented 1 year ago

Hi @faradawn

I tried piml in VScode and get the similar problem. It seems that VScode does not support ipywidgets well. For now, if you want to run notebook locally, I suggest you to use the "jupyter lab" or "jupyter notebook". These two platforms we have tested and PiML works well on them.

In the future, we will try to make PiML adapt to more platforms. Thanks.

faradawn commented 1 year ago

Hi Yu Su,

Jupyter lab worked! I started a jupyter server on the remote machine (where the ML model lives), and port-forwarded it using SSH:

# on the server
conda install -c conda-forge jupyterlab
jupyter lab --no-browser --port 5678
http://localhost:5678/lab?token=b9b7357486ca7ad1d10ef361f31ae66cb3427329a6ff4xxx

# on local
ssh -N -L localhost:6789:localhost:5678 user@server.com
http://localhost:6789/lab?token=b9b7357486ca7ad1d10ef361f31ae66cb3427329a6ff4xxx

The graphs were displayed perfectly!

Screenshot 2023-03-22 at 9 30 54 PM

Thank you so much!