core.components.benchmark.omc_polymorph_reducer#

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

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

Attributes#

Classes#

OMCPolymorphReducer

A common pandas DataFrame reducer for benchmarks

Module Contents#

core.components.benchmark.omc_polymorph_reducer.sklearn_scipy_installed = True#
core.components.benchmark.omc_polymorph_reducer.ev2kJ#
class core.components.benchmark.omc_polymorph_reducer.OMCPolymorphReducer(benchmark_name: str, target_data_key: str, molecule_id_key: str, calculate_structural_metrics: bool = False, index_name: 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

_molecule_id_key#
_calc_structural_metrics#
property runner_type: type[fairchem.core.components.calculate.singlepoint_runner.SinglePointRunner | fairchem.core.components.calculate.relaxation_runner.RelaxationRunner]#

The runner type this reducer is associated with.

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

Compute OMC polymorph metrics for single point or relaxed energy and structure predictions.

Parameters:
  • results – DataFrame containing prediction results with energy values

  • run_name – Identifier for the current evaluation run

Returns:

DataFrame containing computed metrics for different material subsets

save_state(checkpoint_location: str, is_preemption: bool = False) bool#

Save the current state of the reducer to a checkpoint.

Parameters:
  • checkpoint_location – Location to save the checkpoint

  • is_preemption – Whether the save is due to preemption

Returns:

Success status of the save operation

Return type:

bool

load_state(checkpoint_location: str | None) None#

Load reducer state from a checkpoint.

Parameters:

checkpoint_location – Location to load the checkpoint from, or None