You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When plotting the 2 SHAP figures, the figures appear, but the following warning also appears.
st.header('Feature Importance')
plt.title('Feature importance based on SHAP values')
shap.summary_plot(shap_values, X)
st.pyplot(bbox_inches='tight')
st.write('----')
plt.title('Feature importance based on SHAP values (Bar)')
shap.summary_plot(shap_values, X, plot_type='bar')
st.pyplot(bbox_inches='tight')
PyplotGlobalUseWarning: You are calling st.pyplot() without any arguments. After December 1st, 2020, we will remove the ability to do this as it requires the use of Matplotlib's global figure object, which is not thread-safe.
The temporary solution is to configure the streamlit option:
However, is there a solution that does not require disabling deprecation warnings?
For some of the prior examples, like the basketball_app.py, it was easy to determine what to pass as the fig:
st.pyplot(f)
For this streamlit dashboard, which incorporates the SHAP library, what can be passed in as the <fig> in line 81 & 86: st.pyplot(<fig?>, bbox_inches = 'tight')?
When plotting the 2 SHAP figures, the figures appear, but the following warning also appears.
PyplotGlobalUseWarning: You are calling st.pyplot() without any arguments. After December 1st, 2020, we will remove the ability to do this as it requires the use of Matplotlib's global figure object, which is not thread-safe.
The temporary solution is to configure the streamlit option:
st.set_option('deprecation.showPyplotGlobalUse', False)
However, is there a solution that does not require disabling deprecation warnings?
For some of the prior examples, like the basketball_app.py, it was easy to determine what to pass as the fig:
st.pyplot(f)
For this streamlit dashboard, which incorporates the SHAP library, what can be passed in as the
<fig>
in line 81 & 86:st.pyplot(<fig?>, bbox_inches = 'tight')
?Version Reference:
python -
3.10.0
matplotlib -
3.5.1
streamlit -
1.5.1
scikit-learn -
1.0.2
shap -
0.39.0
The text was updated successfully, but these errors were encountered: