Spaces:
Running
Running
Commit
·
16c16dd
1
Parent(s):
6bf538d
fixed app.py issues
Browse files
app.py
CHANGED
@@ -40,7 +40,8 @@ st.write(""" The performance metric used is an estimation of the percentage of c
|
|
40 |
with st.container():
|
41 |
st.write(f"**Overall performance: {overall_performance}%**")
|
42 |
# %%
|
43 |
-
st.header("
|
|
|
44 |
fairness_results = data_dict['Fairness results']
|
45 |
|
46 |
characteristic_list = []
|
@@ -51,7 +52,7 @@ for key, val in fairness_results.items():
|
|
51 |
|
52 |
ch_df = pd.DataFrame({
|
53 |
'Characteristic': characteristic_list,
|
54 |
-
'
|
55 |
})
|
56 |
st.dataframe(ch_df)
|
57 |
|
@@ -106,7 +107,7 @@ st.header("Performance, Fairness, Robustness")
|
|
106 |
embedder_categories = data_dict['Embedder categories']
|
107 |
|
108 |
option = st.selectbox(
|
109 |
-
'Select higher-level categorization:',
|
110 |
list(embedder_categories.keys()))
|
111 |
|
112 |
|
@@ -176,7 +177,7 @@ fig_fair.update_layout(yaxis_title="Performance in %")
|
|
176 |
st.plotly_chart(fig_fair, theme="streamlit", use_container_width=True)
|
177 |
st.markdown("---")
|
178 |
|
179 |
-
|
180 |
|
181 |
t_result = data_dict['Performance Robustness']['Embedder wise results'][option]
|
182 |
# Embedder categories
|
@@ -196,6 +197,8 @@ for item in global_perturber_families:
|
|
196 |
temp_header = f'Perturber family: {family_name}'
|
197 |
# st.markdown(f'##### {temp_header}')
|
198 |
t_pert_fig = px.line(merged_df, x="Levels", y="normalized performance", color='category')
|
|
|
|
|
199 |
# px.line(t_pert_df_global, x="Levels", y="Performance", color='Perturbation family')
|
200 |
t_pert_df_global_temp = t_pert_df_global[t_pert_df_global['Perturbation family'] == family_name].copy(deep=True)
|
201 |
t_pert_df_global_temp['category'] = 'Overall'
|
@@ -205,4 +208,4 @@ for item in global_perturber_families:
|
|
205 |
|
206 |
st.write(f'The following plot illustrates the normalized performance of the model across different categories for perturbation family: {family_name}.')
|
207 |
st.plotly_chart(t_pert_fig, theme="streamlit", use_container_width=True)
|
208 |
-
|
|
|
40 |
with st.container():
|
41 |
st.write(f"**Overall performance: {overall_performance}%**")
|
42 |
# %%
|
43 |
+
st.header("Bias ratios")
|
44 |
+
st.write('Bias ratio is defined as the ratio of the highest performance to the lowest performance among reliable categories for a characteristic.')
|
45 |
fairness_results = data_dict['Fairness results']
|
46 |
|
47 |
characteristic_list = []
|
|
|
52 |
|
53 |
ch_df = pd.DataFrame({
|
54 |
'Characteristic': characteristic_list,
|
55 |
+
'Bias ratio': fairness_ratio_list
|
56 |
})
|
57 |
st.dataframe(ch_df)
|
58 |
|
|
|
107 |
embedder_categories = data_dict['Embedder categories']
|
108 |
|
109 |
option = st.selectbox(
|
110 |
+
'Select higher-level categorization/characteristic:',
|
111 |
list(embedder_categories.keys()))
|
112 |
|
113 |
|
|
|
177 |
st.plotly_chart(fig_fair, theme="streamlit", use_container_width=True)
|
178 |
st.markdown("---")
|
179 |
|
180 |
+
st.write('The following plots show the normalized average performance for each category of a characteristic, for each level of perturbation, starting with no perturbation. Each curve represents the normalized average performance on a category, by which we mean that we divide the average performance at every level of perturbation by the average performance without perturbation. ')
|
181 |
|
182 |
t_result = data_dict['Performance Robustness']['Embedder wise results'][option]
|
183 |
# Embedder categories
|
|
|
197 |
temp_header = f'Perturber family: {family_name}'
|
198 |
# st.markdown(f'##### {temp_header}')
|
199 |
t_pert_fig = px.line(merged_df, x="Levels", y="normalized performance", color='category')
|
200 |
+
t_pert_fig.update_layout(yaxis_title="Normalized performance")
|
201 |
+
|
202 |
# px.line(t_pert_df_global, x="Levels", y="Performance", color='Perturbation family')
|
203 |
t_pert_df_global_temp = t_pert_df_global[t_pert_df_global['Perturbation family'] == family_name].copy(deep=True)
|
204 |
t_pert_df_global_temp['category'] = 'Overall'
|
|
|
208 |
|
209 |
st.write(f'The following plot illustrates the normalized performance of the model across different categories for perturbation family: {family_name}.')
|
210 |
st.plotly_chart(t_pert_fig, theme="streamlit", use_container_width=True)
|
211 |
+
st.markdown("---")
|