Corey Morris commited on
Commit
dfa14a8
1 Parent(s): 43b4e29

Fixed plot

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -3,6 +3,7 @@ import pandas as pd
3
  import os
4
  import fnmatch
5
  import json
 
6
 
7
  class MultiURLData:
8
  def __init__(self):
@@ -74,23 +75,21 @@ selected_models = st.multiselect(
74
  filtered_data = data_provider.get_data(selected_models)
75
  st.dataframe(filtered_data)
76
 
77
-
78
-
79
- #TODO fix this plot. currently has an error
80
  # Create a plot with new data
81
  df = pd.DataFrame({
82
  'Model': list(filtered_data['Model Name']),
83
- 'harness|arc:challenge|25_rank': list(filtered_data['harness|arc:challenge|25_rank']),
84
- 'harness|moral_scenarios|5_rank': list(filtered_data['harness|moral_scenarios|5_rank']),
 
85
  })
86
 
87
  # Calculate color column
88
  df['color'] = 'purple'
89
- df.loc[df['harness|moral_scenarios|5_rank'] < df['harness|arc:challenge|25_rank'], 'color'] = 'red'
90
- df.loc[df['harness|moral_scenarios|5_rank'] > df['harness|arc:challenge|25_rank'], 'color'] = 'blue'
91
 
92
  # Create the scatter plot
93
- fig = px.scatter(df, x='harness|arc:challenge|25_rank', y='harness|moral_scenarios|5_rank', color='color', hover_data=['Model'])
94
  fig.update_layout(showlegend=False, # hide legend
95
  xaxis = dict(autorange="reversed"), # reverse X-axis
96
  yaxis = dict(autorange="reversed")) # reverse Y-axis
 
3
  import os
4
  import fnmatch
5
  import json
6
+ import plotly.express as px
7
 
8
  class MultiURLData:
9
  def __init__(self):
 
75
  filtered_data = data_provider.get_data(selected_models)
76
  st.dataframe(filtered_data)
77
 
 
 
 
78
  # Create a plot with new data
79
  df = pd.DataFrame({
80
  'Model': list(filtered_data['Model Name']),
81
+ # use debug to troubheshoot error
82
+ 'harness|arc:challenge|25': list(filtered_data['harness|arc:challenge|25']),
83
+ 'harness|moral_scenarios|5': list(filtered_data['harness|moral_scenarios|5']),
84
  })
85
 
86
  # Calculate color column
87
  df['color'] = 'purple'
88
+ df.loc[df['harness|moral_scenarios|5'] < df['harness|arc:challenge|25'], 'color'] = 'red'
89
+ df.loc[df['harness|moral_scenarios|5'] > df['harness|arc:challenge|25'], 'color'] = 'blue'
90
 
91
  # Create the scatter plot
92
+ fig = px.scatter(df, x='harness|arc:challenge|25', y='harness|moral_scenarios|5', color='color', hover_data=['Model'])
93
  fig.update_layout(showlegend=False, # hide legend
94
  xaxis = dict(autorange="reversed"), # reverse X-axis
95
  yaxis = dict(autorange="reversed")) # reverse Y-axis