core.components.benchmark.kappa_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#
A common pandas DataFrame reducer for benchmarks |
Module Contents#
- core.components.benchmark.kappa_reducer.mbd_installed = True#
- class core.components.benchmark.kappa_reducer.Kappa103Reducer(benchmark_name: str, target_data_path: str | None = None, target_data_keys: collections.abc.Sequence[str] | None = None, index_name: str | None = 'mp_id')#
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
- property runner_type: type[fairchem.core.components.calculate.kappa_runner.KappaRunner]#
The runner type this reducer is associated with.
- compute_metrics(results: pandas.DataFrame, run_name: str) pandas.DataFrame #
Compute Matbench discovery metrics for 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