High-Level Postprocessing Utilities¤
They assumed you ran a study and now have a collection of results that both need to be melted (-> turned into a long format more suitable for visualization with seaborn or plotly) and concatenated.
Combines loss, metrics, and sample rollout postprocessing.
apebench.melt_concat_from_list
¤
melt_concat_from_list(
raw_file_list: list[pathlib.Path],
base_path: str,
*,
metric_name: Union[str, list[str]] = "mean_nRMSE",
metric_file_name: str = "metrics",
loss_file_name: str = "train_loss",
sample_rollout_file_name: str = "sample_rollout",
do_metrics: bool = True,
do_loss: bool = False,
do_sample_rollouts: bool = False
) -> tuple[
Optional[pathlib.Path],
Optional[pathlib.Path],
Optional[pathlib.Path],
]
Melt and concatenate metrics, loss and sample rollouts from a list of raw
files and save the resulting DataFrames to disk as CSV files. Use this
function on the results of apebench.run_study
.
Arguments:
raw_file_list
: A list of paths to the raw data files.base_path
: The base path to store the results in.metric_name
: The name of the metric to melt.metric_file_name
: The name of the file to save the metrics to.loss_file_name
: The name of the file to save the loss to.sample_rollout_file_name
: The name of the file to save the sample rollouts to.do_metrics
: Whether to melt and save the metrics.do_loss
: Whether to melt and save the loss.do_sample_rollouts
: Whether to melt and save the sample rollouts.
Returns:
metric_df_file_name
: The path to the metrics file.loss_df_file_name
: The path to the loss file.sample_rollout_df_file_name
: The path to the sample rollouts file.
Source code in apebench/_run.py
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 |
|
apebench.melt_concat_loss_from_list
¤
melt_concat_loss_from_list(
raw_file_list: list[pathlib.Path],
) -> pd.DataFrame
Melt and concatenate loss from a list of raw files. Use this function on the
results of apebench.run_study
.
Arguments:
raw_file_list
: A list of paths to the raw data files.
Returns:
loss_df
: The DataFrame containing the loss.
Source code in apebench/_run.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
|
apebench.melt_concat_metrics_from_list
¤
melt_concat_metrics_from_list(
raw_file_list: list[pathlib.Path],
*,
metric_name: Union[str, list[str]] = "mean_nRMSE"
) -> pd.DataFrame
Melt and concatenate metrics from a list of raw files. Use this function on
the results of apebench.run_study
.
Arguments:
raw_file_list
: A list of paths to the raw data files.metric_name
: The name of the metric to melt.
Returns:
metric_df
: The DataFrame containing the metrics.
Source code in apebench/_run.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
|
apebench.melt_concat_sample_rollouts_from_list
¤
melt_concat_sample_rollouts_from_list(
raw_file_list: list[pathlib.Path],
) -> pd.DataFrame
Melt and concatenate sample rollouts from a list of raw files. Use this
function on the results of apebench.run_study
.
Arguments:
raw_file_list
: A list of paths to the raw data files.
Returns:
sample_rollout_df
: The DataFrame containing the sample rollouts.
Source code in apebench/_run.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
|