Zekun Wu commited on
Commit
1955778
1 Parent(s): 6bf4517
Files changed (2) hide show
  1. pages/2_Evaluation.py +3 -2
  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
- corr_fig = create_correlation_heatmaps(df)
86
- st.plotly_chart(corr_fig)
 
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
- fig = go.Figure()
89
-
90
- # fig.add_trace(go.Heatmap(
91
- # z=scores_corr_pearson.values,
92
- # x=scores_corr_pearson.columns,
93
- # y=scores_corr_pearson.index,
94
- # colorscale='Viridis',
95
- # showscale=True,
96
- # name='Scores Pearson Correlation'
97
- # ))
98
-
99
- fig.add_trace(go.Heatmap(
100
- z=ranks_corr_pearson.values,
101
- x=ranks_corr_pearson.columns,
102
- y=ranks_corr_pearson.index,
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