Corey Morris
commited on
Commit
•
52d3b03
1
Parent(s):
02b1702
Added organization to dataframe
Browse files
result_data_processor.py
CHANGED
@@ -91,12 +91,16 @@ class ResultDataProcessor:
|
|
91 |
dataframes = []
|
92 |
for filename in self._find_files(self.directory, self.pattern):
|
93 |
raw_data = self._read_and_transform_data(filename)
|
94 |
-
|
|
|
|
|
95 |
cleaned_data = self._cleanup_dataframe(raw_data, model_name)
|
96 |
mc1 = self._extract_mc1(raw_data, model_name)
|
97 |
mc2 = self._extract_mc2(raw_data, model_name)
|
98 |
cleaned_data = pd.concat([cleaned_data, mc1])
|
99 |
cleaned_data = pd.concat([cleaned_data, mc2])
|
|
|
|
|
100 |
dataframes.append(cleaned_data)
|
101 |
|
102 |
|
|
|
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('/')
|
95 |
+
model_name = split_path[2]
|
96 |
+
organization_name = split_path[1]
|
97 |
cleaned_data = self._cleanup_dataframe(raw_data, model_name)
|
98 |
mc1 = self._extract_mc1(raw_data, model_name)
|
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 |
+
# add organization name to the dataframe as a new row
|
103 |
+
cleaned_data.loc['organization'] = organization_name
|
104 |
dataframes.append(cleaned_data)
|
105 |
|
106 |
|
test_result_data_processing.py
CHANGED
@@ -18,7 +18,7 @@ class TestResultDataProcessor(unittest.TestCase):
|
|
18 |
self.assertIn('Parameters', data.columns)
|
19 |
self.assertIn('MMLU_average', data.columns)
|
20 |
# check number of columns
|
21 |
-
self.assertEqual(len(data.columns),
|
22 |
|
23 |
# check that the number of rows is correct
|
24 |
def test_rows(self):
|
|
|
18 |
self.assertIn('Parameters', data.columns)
|
19 |
self.assertIn('MMLU_average', data.columns)
|
20 |
# check number of columns
|
21 |
+
self.assertEqual(len(data.columns), 64)
|
22 |
|
23 |
# check that the number of rows is correct
|
24 |
def test_rows(self):
|