Spaces:
Runtime error
Runtime error
Corey Morris
commited on
Commit
·
e79bcf3
1
Parent(s):
d506f10
Fixed type error
Browse files- app.py +1 -1
- result_data_processor.py +6 -5
app.py
CHANGED
|
@@ -105,7 +105,7 @@ def create_line_chart(df, model_names, metrics):
|
|
| 105 |
fig.update_layout(showlegend=True)
|
| 106 |
return fig
|
| 107 |
|
| 108 |
-
def find_top_differences_table(df, target_model, closest_models, num_differences=10, exclude_columns=['Parameters']):
|
| 109 |
# Calculate the absolute differences for each task between the target model and the closest models
|
| 110 |
new_df = df.drop(columns=exclude_columns)
|
| 111 |
differences = new_df.loc[closest_models].sub(new_df.loc[target_model]).abs()
|
|
|
|
| 105 |
fig.update_layout(showlegend=True)
|
| 106 |
return fig
|
| 107 |
|
| 108 |
+
def find_top_differences_table(df, target_model, closest_models, num_differences=10, exclude_columns=['Parameters', 'organization']):
|
| 109 |
# Calculate the absolute differences for each task between the target model and the closest models
|
| 110 |
new_df = df.drop(columns=exclude_columns)
|
| 111 |
differences = new_df.loc[closest_models].sub(new_df.loc[target_model]).abs()
|
result_data_processor.py
CHANGED
|
@@ -89,6 +89,7 @@ class ResultDataProcessor:
|
|
| 89 |
def process_data(self):
|
| 90 |
|
| 91 |
dataframes = []
|
|
|
|
| 92 |
for filename in self._find_files(self.directory, self.pattern):
|
| 93 |
raw_data = self._read_and_transform_data(filename)
|
| 94 |
split_path = filename.split('/')
|
|
@@ -99,13 +100,15 @@ class ResultDataProcessor:
|
|
| 99 |
mc2 = self._extract_mc2(raw_data, model_name)
|
| 100 |
cleaned_data = pd.concat([cleaned_data, mc1])
|
| 101 |
cleaned_data = pd.concat([cleaned_data, mc2])
|
| 102 |
-
|
| 103 |
-
cleaned_data.loc['organization'] = organization_name
|
| 104 |
dataframes.append(cleaned_data)
|
| 105 |
|
| 106 |
|
| 107 |
data = pd.concat(dataframes, axis=1).transpose()
|
| 108 |
-
|
|
|
|
|
|
|
|
|
|
| 109 |
# Add Model Name and rearrange columns
|
| 110 |
data['Model Name'] = data.index
|
| 111 |
cols = data.columns.tolist()
|
|
@@ -137,8 +140,6 @@ class ResultDataProcessor:
|
|
| 137 |
# remove extreme outliers from column harness|truthfulqa:mc1
|
| 138 |
data = self._remove_mc1_outliers(data)
|
| 139 |
|
| 140 |
-
data = data.drop(columns=['organization'])
|
| 141 |
-
|
| 142 |
return data
|
| 143 |
|
| 144 |
def rank_data(self):
|
|
|
|
| 89 |
def process_data(self):
|
| 90 |
|
| 91 |
dataframes = []
|
| 92 |
+
organization_names = []
|
| 93 |
for filename in self._find_files(self.directory, self.pattern):
|
| 94 |
raw_data = self._read_and_transform_data(filename)
|
| 95 |
split_path = filename.split('/')
|
|
|
|
| 100 |
mc2 = self._extract_mc2(raw_data, model_name)
|
| 101 |
cleaned_data = pd.concat([cleaned_data, mc1])
|
| 102 |
cleaned_data = pd.concat([cleaned_data, mc2])
|
| 103 |
+
organization_names.append(organization_name)
|
|
|
|
| 104 |
dataframes.append(cleaned_data)
|
| 105 |
|
| 106 |
|
| 107 |
data = pd.concat(dataframes, axis=1).transpose()
|
| 108 |
+
|
| 109 |
+
# Add organization column
|
| 110 |
+
data['organization'] = organization_names
|
| 111 |
+
|
| 112 |
# Add Model Name and rearrange columns
|
| 113 |
data['Model Name'] = data.index
|
| 114 |
cols = data.columns.tolist()
|
|
|
|
| 140 |
# remove extreme outliers from column harness|truthfulqa:mc1
|
| 141 |
data = self._remove_mc1_outliers(data)
|
| 142 |
|
|
|
|
|
|
|
| 143 |
return data
|
| 144 |
|
| 145 |
def rank_data(self):
|