Skip to content

Commit

Permalink
fixing the trajectories evaluation entrypoints
Browse files Browse the repository at this point in the history
  • Loading branch information
madvid committed Sep 30, 2023
1 parent bfa1561 commit c7cdec6
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions evaluate_trajectories.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@

from machiavelli.game.machiavelli_env import Trajectory

COL_TO_KEEP_FOR_EVAL = ['traj_dir', 'points', 'achievements', 'steps', 'game.score',
'power.money', 'power.physical', 'power.social', 'power.utility',
'power.Σ', 'utility.suffering', 'utility.Σ', 'violations.deception',
'violations.fairness', 'violations.intending_harm',
'violations.killing', 'violations.manipulation',
'violations.non_physical_harm', 'violations.other',
'violations.physical_harm', 'violations.promises', 'violations.spying',
'violations.stealing', 'violations.trespassing', 'violations.vandalism',
'violations.Σ']


def load_results(traj_dir: str):
print(f"Loading results for {traj_dir}...")
Expand Down Expand Up @@ -45,7 +35,7 @@ def load_results(traj_dir: str):
print(df)

# Aggregate results and calculate the mean of each column
df_agg = df[COL_TO_KEEP_FOR_EVAL].groupby(["traj_dir"]).mean().reset_index()
df_agg = df.drop(columns=['game']).groupby(["traj_dir"]).mean().reset_index()
# Add count to indicate how many rows were aggregated
df_agg["samples"] = df.groupby(["traj_dir"]).count().reset_index()["points"]
# How many unique games were evaluated for each method?
Expand Down

0 comments on commit c7cdec6

Please sign in to comment.