CultriX commited on
Commit
a47ba5f
·
verified ·
1 Parent(s): b049de2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -97,10 +97,11 @@ def calculate_highest_combined_score(data, column):
97
  top_combinations[r] = top_combinations[r][:3]
98
  return column, top_combinations
99
 
100
- def display_highest_combined_scores(data, score_columns):
101
- for column in score_columns:
102
- _, top_combinations = calculate_highest_combined_score(data, column)
103
- if top_combinations:
 
104
  st.subheader(f"Top Combinations for {column}")
105
  for r, combinations in top_combinations.items():
106
  st.write(f"**Number of Models: {r}**")
@@ -109,6 +110,7 @@ def display_highest_combined_scores(data, score_columns):
109
 
110
 
111
 
 
112
  # Function to create bar chart for a given category
113
  def create_bar_chart(df, category):
114
  """Create and display a bar chart for a given category."""
@@ -238,10 +240,10 @@ def main():
238
  with col4:
239
  create_bar_chart(df, score_columns[4])
240
 
241
-
242
- except Exception as e:
243
- st.error("An error occurred while processing the markdown table.")
244
- st.error(str(e))
245
  else:
246
  st.error("Failed to download the content from the URL provided.")
247
  # About tab
 
97
  top_combinations[r] = top_combinations[r][:3]
98
  return column, top_combinations
99
 
100
+ # Function to display the results of the highest combined scores
101
+ def display_highest_combined_scores(data):
102
+ with st.spinner('Calculating highest combined scores...'):
103
+ results = [calculate_highest_combined_score(data, col) for col in score_columns]
104
+ for column, top_combinations in results:
105
  st.subheader(f"Top Combinations for {column}")
106
  for r, combinations in top_combinations.items():
107
  st.write(f"**Number of Models: {r}**")
 
110
 
111
 
112
 
113
+
114
  # Function to create bar chart for a given category
115
  def create_bar_chart(df, category):
116
  """Create and display a bar chart for a given category."""
 
240
  with col4:
241
  create_bar_chart(df, score_columns[4])
242
 
243
+ display_highest_combined_scores(full_df) # Call to display the calculated scores
244
+ except Exception as e:
245
+ st.error("An error occurred while processing the markdown table.")
246
+ st.error(str(e))
247
  else:
248
  st.error("Failed to download the content from the URL provided.")
249
  # About tab