rxn.metrics.forward_metrics.ForwardMetrics

class rxn.metrics.forward_metrics.ForwardMetrics(gt_products, predicted_products)[source]

Bases: MetricsCalculator

Class to compute common metrics for forward models, starting from files containing the ground truth and predictions.

Note: all files are expected to be standardized (canonicalized, sorted, etc.).

Parameters
  • gt_products (Iterable[str]) –

  • predicted_products (Iterable[str]) –

__init__(gt_products, predicted_products)[source]
Parameters
  • gt_products (Iterable[str]) –

  • predicted_products (Iterable[str]) –

Methods

__init__(gt_products, predicted_products)

param gt_products

from_metrics_files(metrics_files)

Build the instance from the MetricsFiles object.

from_raw_files(gt_products_file, ...)

param gt_products_file

get_metrics()

Calculate the metrics.

classmethod from_metrics_files(metrics_files)[source]

Build the instance from the MetricsFiles object.

Parameters

metrics_files (MetricsFiles) –

Return type

ForwardMetrics

get_metrics()[source]

Calculate the metrics.

Note: the paths to ground truth and prediction are to be set in the constructor of the derived class.

Return type

Dict[str, Any]