Dataframe Manipulation¤
apebench.read_in_kwargs
¤
read_in_kwargs(df: pd.DataFrame) -> pd.DataFrame
Parse the scenario_kwargs
column of a DataFrame and add the parsed entries
as new columns.
Requires that the dictionary in scenario_kwargs
has the same keys for all
rows.
Source code in apebench/_utils.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
|
apebench.split_train
¤
split_train(metric_data: pd.DataFrame) -> pd.DataFrame
Decode the train
column into category
, type
, and rollout
columns.
Source code in apebench/_utils.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
apebench.aggregate_gmean
¤
aggregate_gmean(
metric_data: pd.DataFrame,
*,
up_to: int = 100,
grouping_cols: list[str] = BASE_NAMES
) -> pd.DataFrame
Aggregate an error rollout over time via the geometric mean.
Args:
metric_data
: The DataFrame to aggregate, must containgrouping_cols
andmean_nRMSE
as columns. When grouped bygrouping_cols
, the groups shall only contain values at different time steps.up_to
: The time step up to which to aggregate. (inclusive)grouping_cols
: The columns to group by.
Returns:
- A DataFrame with the new column
gmean_mean_nRMSE
containing the geometric mean of themean_nRMSE
values up toup_to
for each group.
Source code in apebench/_utils.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|
apebench.relative_by_config
¤
relative_by_config(
data: pd.DataFrame,
*,
grouping_cols: list[str] = BASE_NAMES_NO_TRAIN,
norm_query: str = "train == 'one'",
value_col: str = "mean_nRMSE",
suffix: str = "_rel"
) -> pd.DataFrame
Source code in apebench/_utils.py
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
|