core.components.benchmark.omol_reducer#

Copyright (c) Meta, Inc. and its affiliates.

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Attributes#

R

M

Classes#

OMolReducer

A common pandas DataFrame reducer for benchmarks

Module Contents#

core.components.benchmark.omol_reducer.R#
core.components.benchmark.omol_reducer.M#
class core.components.benchmark.omol_reducer.OMolReducer(benchmark_name: str, evaluator: Callable | None = None, benchmark_labels: str | None = None)#

Bases: fairchem.core.components.benchmark.benchmark_reducer.JsonDFReducer

A common pandas DataFrame reducer for benchmarks

Results are assumed to be saved as json files that can be read into pandas dataframes. Only mean absolute error is computed for common columns in the predicted results and target data

benchmark_name#
benchmark_labels#
evaluator#
join_results(results_dir: str, glob_pattern: str) pandas.DataFrame#

Join results from multiple JSON files into a single DataFrame.

Parameters:
  • results_dir – Directory containing result files

  • glob_pattern – Pattern to match result files

Returns:

Combined DataFrame containing all results

save_results(results: pandas.DataFrame, results_dir: str) None#

Save joined results to a compressed json file

Parameters:
  • results – results: Combined results from join_results

  • results_dir – Directory containing result files

compute_metrics(results: dict, run_name: str) pandas.DataFrame#

Compute mean absolute error metrics for common columns between results and targets.

Parameters:
  • results – DataFrame containing prediction results

  • run_name – Name of the current run, used as index in the metrics DataFrame

Returns:

DataFrame containing computed metrics with run_name as index