Skip to main content

Metrics for RXN models

Project description

RXN package for the calculation of metrics for OpenNMT-based models

Actions tests

This repository contains a Python package and associated scripts for training reaction models based on the OpenNMT library. This repository is closely related to rxn-onmt-models, which handles the training pipelines for these models. The repository also relies on other RXN packages; see rxn-utilities, rxn-chemutils, and rxn-onmt-utils.

Links:

This repository was produced through a collaborative project involving IBM Research Europe and Syngenta.

System Requirements

This package is supported on all operating systems. It has been tested on the following systems:

  • macOS: Big Sur (11.1)
  • Linux: Ubuntu 18.04.4

A Python version of 3.6, 3.7, or 3.8 is recommended. Python versions 3.9 and above are not expe`cted to work due to compatibility with the selected version of OpenNMT.

Installation guide

The package can be installed from Pypi:

pip install rxn-metrics[rdkit,rxnmapper]

You can leave out the extra dependency rdkit if RDKit is already available in your environment. Also, you can leave out the extra dependency rxnmapper if you don't plan on calculating the "true reactant" accuracy.

For local development, the package can be installed with:

pip install -e ".[dev,rdkit,rxnmapper]"

Calculation of metrics

The metrics are best calculated by launching one of the following scripts:

  • rxn-prepare-context-metrics
  • rxn-prepare-forward-metrics
  • rxn-prepare-retro-metrics Note that these scripts will run the models directly to limit the likelihood of making errors.

If the prediction files are available already, the script rxn-evaluate-metrics will compute the metrics only.

To aggregate all the metrics for different models (typically: after tuning the hyperparameters), you can run the script rxn-parse-metrics-into-csv.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rxn-metrics-1.1.0.tar.gz (22.5 kB view hashes)

Uploaded Source

Built Distribution

rxn_metrics-1.1.0-py3-none-any.whl (27.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page