Spaces:
Sleeping
Sleeping
Commit
·
6360161
1
Parent(s):
b5f1b34
Update app.py
Browse files
app.py
CHANGED
@@ -130,11 +130,11 @@ if len(gene_list) > 1:
|
|
130 |
df_shap = df_total[df_total.index.isin(gene_list)]
|
131 |
df_shap.drop(columns='XGB_Score', inplace=True)
|
132 |
shap_values = explainer.shap_values(df_shap)
|
133 |
-
summary_plot = shap.summary_plot(shap_values, df_shap
|
134 |
st.caption("SHAP Summary Plot of All Input Genes")
|
135 |
st.pyplot(fig=summary_plot)
|
136 |
st.caption("Interactive SHAP Summary Plot of All Input Genes")
|
137 |
-
mpl_fig = shap_summary_plot(shap_values, df_shap, show=False)
|
138 |
plotly_fig = tls.mpl_to_plotly(mpl_fig)
|
139 |
plotly_fig['layout'] = {'xaxis': {'title': 'SHAP value (impact on model output)'}}
|
140 |
|
|
|
130 |
df_shap = df_total[df_total.index.isin(gene_list)]
|
131 |
df_shap.drop(columns='XGB_Score', inplace=True)
|
132 |
shap_values = explainer.shap_values(df_shap)
|
133 |
+
summary_plot = shap.summary_plot(shap_values, df_shap)
|
134 |
st.caption("SHAP Summary Plot of All Input Genes")
|
135 |
st.pyplot(fig=summary_plot)
|
136 |
st.caption("Interactive SHAP Summary Plot of All Input Genes")
|
137 |
+
mpl_fig = shap_summary_plot(shap_values, df_shap, max_display=20, show=False)
|
138 |
plotly_fig = tls.mpl_to_plotly(mpl_fig)
|
139 |
plotly_fig['layout'] = {'xaxis': {'title': 'SHAP value (impact on model output)'}}
|
140 |
|