Spaces:
Running
Running
Zekun Wu
commited on
Commit
·
1955778
1
Parent(s):
6bf4517
update
Browse files- pages/2_Evaluation.py +3 -2
- util/plot.py +16 -64
pages/2_Evaluation.py
CHANGED
@@ -82,8 +82,9 @@ def app():
|
|
82 |
x='variable', y='value', color='variable', title='Spread of Ranks')
|
83 |
st.plotly_chart(box_rank_fig)
|
84 |
|
85 |
-
|
86 |
-
|
|
|
87 |
|
88 |
st.download_button(
|
89 |
label="Download Evaluation Results",
|
|
|
82 |
x='variable', y='value', color='variable', title='Spread of Ranks')
|
83 |
st.plotly_chart(box_rank_fig)
|
84 |
|
85 |
+
heatmaps = create_correlation_heatmaps(df)
|
86 |
+
for title, fig in heatmaps.items():
|
87 |
+
st.plotly_chart(fig)
|
88 |
|
89 |
st.download_button(
|
90 |
label="Download Evaluation Results",
|
util/plot.py
CHANGED
@@ -84,67 +84,19 @@ def create_correlation_heatmaps(df):
|
|
84 |
scores_corr_kendall = scores_df.corr(method='kendall')
|
85 |
ranks_corr_kendall = ranks_df.corr(method='kendall')
|
86 |
|
87 |
-
# Plotting the heatmaps
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
colorscale='Viridis',
|
104 |
-
showscale=True,
|
105 |
-
name='Ranks Pearson Correlation'
|
106 |
-
))
|
107 |
-
|
108 |
-
# fig.add_trace(go.Heatmap(
|
109 |
-
# z=scores_corr_spearman.values,
|
110 |
-
# x=scores_corr_spearman.columns,
|
111 |
-
# y=scores_corr_spearman.index,
|
112 |
-
# colorscale='Cividis',
|
113 |
-
# showscale=True,
|
114 |
-
# name='Scores Spearman Correlation'
|
115 |
-
# ))
|
116 |
-
#
|
117 |
-
# fig.add_trace(go.Heatmap(
|
118 |
-
# z=ranks_corr_spearman.values,
|
119 |
-
# x=ranks_corr_spearman.columns,
|
120 |
-
# y=ranks_corr_spearman.index,
|
121 |
-
# colorscale='Cividis',
|
122 |
-
# showscale=True,
|
123 |
-
# name='Ranks Spearman Correlation'
|
124 |
-
# ))
|
125 |
-
|
126 |
-
# fig.add_trace(go.Heatmap(
|
127 |
-
# z=scores_corr_kendall.values,
|
128 |
-
# x=scores_corr_kendall.columns,
|
129 |
-
# y=scores_corr_kendall.index,
|
130 |
-
# colorscale='Inferno',
|
131 |
-
# showscale=True,
|
132 |
-
# name='Scores Kendall Correlation'
|
133 |
-
# ))
|
134 |
-
#
|
135 |
-
# fig.add_trace(go.Heatmap(
|
136 |
-
# z=ranks_corr_kendall.values,
|
137 |
-
# x=ranks_corr_kendall.columns,
|
138 |
-
# y=ranks_corr_kendall.index,
|
139 |
-
# colorscale='Inferno',
|
140 |
-
# showscale=True,
|
141 |
-
# name='Ranks Kendall Correlation'
|
142 |
-
# ))
|
143 |
-
|
144 |
-
# Update layout
|
145 |
-
fig.update_layout(
|
146 |
-
title='Correlation Heatmaps',
|
147 |
-
xaxis_nticks=36
|
148 |
-
)
|
149 |
-
|
150 |
-
return fig
|
|
|
84 |
scores_corr_kendall = scores_df.corr(method='kendall')
|
85 |
ranks_corr_kendall = ranks_df.corr(method='kendall')
|
86 |
|
87 |
+
# Plotting the heatmaps separately
|
88 |
+
heatmaps = {
|
89 |
+
'Scores Pearson Correlation': scores_corr_pearson,
|
90 |
+
'Ranks Pearson Correlation': ranks_corr_pearson,
|
91 |
+
'Scores Spearman Correlation': scores_corr_spearman,
|
92 |
+
'Ranks Spearman Correlation': ranks_corr_spearman,
|
93 |
+
'Scores Kendall Correlation': scores_corr_kendall,
|
94 |
+
'Ranks Kendall Correlation': ranks_corr_kendall
|
95 |
+
}
|
96 |
+
|
97 |
+
figs = {}
|
98 |
+
for title, corr_matrix in heatmaps.items():
|
99 |
+
fig = px.imshow(corr_matrix, text_auto=True, title=title)
|
100 |
+
figs[title] = fig
|
101 |
+
|
102 |
+
return figs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|