Spaces:
Running
Running
jasonshaoshun
commited on
Commit
·
4cc7bcf
1
Parent(s):
8b331af
debug
Browse files- src/populate.py +3 -2
src/populate.py
CHANGED
@@ -222,20 +222,21 @@ def create_intervention_averaged_df(df: pd.DataFrame) -> pd.DataFrame:
|
|
222 |
# return detailed_df
|
223 |
|
224 |
def get_leaderboard_df_mib_causalgraph(results_path: str, requests_path: str, cols: list, benchmark_cols: list) -> Tuple[pd.DataFrame, pd.DataFrame, pd.DataFrame]:
|
225 |
-
"""Creates three dataframes from all the MIB causal graph experiment results"""
|
226 |
print(f"results_path is {results_path}, requests_path is {requests_path}")
|
227 |
raw_data = get_raw_eval_results_mib_causalgraph(results_path, requests_path)
|
228 |
-
print(f"raw_data is {raw_data}")
|
229 |
|
230 |
# Convert each result to dict format for detailed df
|
231 |
all_data_json = [v.to_dict() for v in raw_data]
|
232 |
detailed_df = pd.DataFrame.from_records(all_data_json)
|
|
|
233 |
|
234 |
# Create aggregated df
|
235 |
aggregated_df = aggregate_methods(detailed_df)
|
|
|
236 |
|
237 |
# Create intervention-averaged df
|
238 |
intervention_averaged_df = create_intervention_averaged_df(aggregated_df)
|
|
|
239 |
|
240 |
return detailed_df, aggregated_df, intervention_averaged_df
|
241 |
|
|
|
222 |
# return detailed_df
|
223 |
|
224 |
def get_leaderboard_df_mib_causalgraph(results_path: str, requests_path: str, cols: list, benchmark_cols: list) -> Tuple[pd.DataFrame, pd.DataFrame, pd.DataFrame]:
|
|
|
225 |
print(f"results_path is {results_path}, requests_path is {requests_path}")
|
226 |
raw_data = get_raw_eval_results_mib_causalgraph(results_path, requests_path)
|
|
|
227 |
|
228 |
# Convert each result to dict format for detailed df
|
229 |
all_data_json = [v.to_dict() for v in raw_data]
|
230 |
detailed_df = pd.DataFrame.from_records(all_data_json)
|
231 |
+
print("Columns in detailed_df:", detailed_df.columns.tolist()) # Print actual columns
|
232 |
|
233 |
# Create aggregated df
|
234 |
aggregated_df = aggregate_methods(detailed_df)
|
235 |
+
print("Columns in aggregated_df:", aggregated_df.columns.tolist())
|
236 |
|
237 |
# Create intervention-averaged df
|
238 |
intervention_averaged_df = create_intervention_averaged_df(aggregated_df)
|
239 |
+
print("Columns in intervention_averaged_df:", intervention_averaged_df.columns.tolist())
|
240 |
|
241 |
return detailed_df, aggregated_df, intervention_averaged_df
|
242 |
|