# Enrichment factor, robust initial enhancement and BEDROC of a ranked list, version 2.0.0

score-early-recognition\@2.0.0: this version's equations with their symbols, each constant's value, their sources and whether each was read, a worked example where the record holds one, its level and what it was checked against, the number of cases, and what was not checked. This version's record is not rewritten; a correction is added under Changes.

## What this page can and cannot show

**Level: Checked against a reference; Secondary source (Riniker and Landrum 2013); Truchon and Bayly 2007 unread; RDKit shares an author. Reference kind: our own exact-arithmetic script and a hand-worked case.**

Checked by this project, not independently reviewed. Every method on this page has its equations, constants, sources and cases on record, and its cases agree with the stated reference within the stated tolerance. A reader can follow each method's worked example by hand; that shows the stated method gives the stated answer for one set of inputs, and does not test the code. The other cases and their values are not printed, so a reader cannot re-run these checks. No independent scientist has yet reviewed them.

[Every version of this method](https://www.drybench.com/methods/m/score-early-recognition) · [Every method](https://www.drybench.com/methods/m) · [What the levels mean](https://www.drybench.com/methods/levels)

## Version 2.0.0

**Level: Checked against a reference; Secondary source (Riniker and Landrum 2013); Truchon and Bayly 2007 unread; RDKit shares an author. Reference kind: our own exact-arithmetic script and a hand-worked case.** `score-early-recognition@2.0.0`

Built, not hosted. Generated from a snapshot of the library's records taken on 2026-11-25, as committed on 2026-11-25. A later snapshot replaces this one, so these records and this page can change.

**Verification statement:** EF, RIE and BEDROC as in Riniker and Landrum 2013 (Eqs. 2 and 4 to 7), a secondary source re-read at source 14 November 2026 with matching SHA-256; Truchon and Bayly 2007 not read. BEDROC is formed as a ratio of two sums of non-negative terms, equal to Eq. 7, so it lies between 0 and 1 and is exact at both structural ends. Compared with RDKit 2026.03.6 on 17 cases (its scoring module is maintained by an author of the source) and with a second implementation in Python by a separate agent of the same model family (57 cases, 24 at the edges).

From the ranks of the n actives among N ranked items: the enrichment factor at a cut the caller states as a count, the fraction of actives inside the cut over the fraction expected at random; the robust initial enhancement (RIE) at a stated alpha, the sum of e^(−α·r/N) over the actives over its expectation for actives placed at random; and BEDROC, RIE rescaled between its smallest and largest possible values. The cut and alpha are never defaulted; either may be left out, and its scores are then not returned. BEDROC is formed as a ratio of two sums of non-negative terms equal to Eq. 7, so it lies between 0 and 1 and is exactly 0 with the actives in the last ranks and exactly 1 with them in the first; it is withheld when every item is an active. The ranks are checked in the order given; at each rank, a whole number (NOT\_AN\_INTEGER), then not above the total (RANK\_ABOVE\_TOTAL), then not a repeat (DUPLICATE\_RANK), and the first failure is returned. A rank of 0 or below gets the kit's OUT\_OF\_RANGE, and more than 10,000 ranks get TOO\_MANY\_VALUES.

- **How results are reported:** none: full double precision
- **Uncertainty:** Arithmetic on the caller's ranks; no sampling interval is computed for any score.
- **Reference, as its record states it:** Exact arithmetic (Python fractions; exponentials at 60 digits), checked against RDKit 2026.03.6 and the structural cases
- **Level confirmed by this project's ruling of** 14 November 2026

[What this page can and cannot show](#what-this-page-can-and-cannot-show)

### What was checked

90 cases in 2 files, linked by this exact version.

Run through the tool at build against our own exact-arithmetic script and a hand-worked case: 65 agree within the tolerance the file states, 25 refuse as the case expects, 0 differ, 0 were not run.

- **File 1, 33 cases**
  - **Where the expected values came from:** our own exact-arithmetic script and a hand-worked case
  - **Recorded on:** 2026-11-14
  - **Reference:** Python standard library (fractions, decimal), 3.13.18; licence PSF-2.0
  - **Tolerance as the file states it:** the enrichment factor, RIE and BEDROC relative 1e-12, with a floor of 1e-15 below 1e-3; the count of actives in the top, statuses, codes, withholding rules and units exact

- **File 2, 57 cases**
  - **Where the expected values came from:** our own exact-arithmetic script and a hand-worked case
  - **Recorded on:** 2026-11-14
  - **Reference:** second implementation by a fresh agent (Python 3.13), 2026-11-14; licence BSD-3-Clause
  - **Tolerance as the file states it:** every number relative 1e-15 (absolute 1e-30 below 1e-15, in each value's unit); counts, statuses, codes, labels and strings exact

Apart from the worked example, the cases and their values are not printed here. This shows agreement with this project's recorded cases. It does not show that a method suits your work, and it is not a qualification.

### What was not checked

Truchon and Bayly (2007), the primary source of RIE's closed form and of BEDROC, unread; how the caller broke ties; alpha outside the range; the interpretation of BEDROC as a probability, which its authors tie to a condition on alpha and the fraction of actives; RDKit's scoring module is maintained by an author of the read source, so agreement with it does not test the reading of that source separately.

### Definition or model

A closed form: the result follows from the inputs by the equations alone.

### Equations

**Equation 1**

```equation
EF = (a/t)/(n/N)
```

| Symbol | Meaning and unit |
| --- | --- |
| N | the number of items in the ranked list (argument total) |
| n | the number of actives, the length of argument activeRanks |
| r\_i | the rank of the i-th active, a whole number from 1 (the best-scored item) to N (argument activeRanks) |
| t | the cut, as a count of top-ranked items (argument topCount); the source writes it χ·N |
| a | the number of actives whose rank is at most t, returned as activesInTop |
| EF | enrichment factor, returned as enrichmentFactor |

Source: Riniker S, Landrum GA, Open-source platform to benchmark fingerprints for ligand-based virtual screening, J Cheminform 5:26 (2013), equation 2, section Evaluation methods, Enrichment Factor (EF), version of record (BMC) as deposited in PMC; Europe PMC's JATS XML, not the publisher's copy; read in full on 2026-11-12 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning 3dfeb6827620. Free to read (CC BY 2.0), checked 2026-11-12. No erratum found (searched crossref, europe-pmc, retraction-watch), 2026-11-12.

**Equation 2**

```equation
RIE = Σᵢ e^(−α·r_i/N) / ((n/N)·(1 − e^(−α))/(e^(α/N) − 1))
```

| Symbol | Meaning and unit |
| --- | --- |
| N | the number of items in the ranked list (argument total) |
| n | the number of actives, the length of argument activeRanks |
| r\_i | the rank of the i-th active, a whole number from 1 (the best-scored item) to N (argument activeRanks) |
| α | the early-recognition weight: larger values weight the top of the list more (argument alpha) |
| RIE | robust initial enhancement, returned as robustInitialEnhancement; 1 for actives placed at random |

Source: Riniker S, Landrum GA, Open-source platform to benchmark fingerprints for ligand-based virtual screening, J Cheminform 5:26 (2013), equation 4, section Evaluation methods, Robust Initial Enhancement (RIE), version of record (BMC) as deposited in PMC; Europe PMC's JATS XML, not the publisher's copy; read in full on 2026-11-12 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning 3dfeb6827620. Free to read (CC BY 2.0), checked 2026-11-12. No erratum found (searched crossref, europe-pmc, retraction-watch), 2026-11-12.

**Equation 3**

```equation
RIE_min = (N/n)·(1 − e^(α·n/N))/(1 − e^α)
RIE_max = (N/n)·(1 − e^(−α·n/N))/(1 − e^(−α))
```

| Symbol | Meaning and unit |
| --- | --- |
| N | the number of items in the ranked list (argument total) |
| n | the number of actives, the length of argument activeRanks |
| α | the early-recognition weight: larger values weight the top of the list more (argument alpha) |
| RIE\_min | RIE with every active at the bottom of the list |
| RIE\_max | RIE with every active at the top of the list |

Source: Riniker S, Landrum GA, Open-source platform to benchmark fingerprints for ligand-based virtual screening, J Cheminform 5:26 (2013), equation 5 and 6, section Evaluation methods, Robust Initial Enhancement (RIE), at its end, version of record (BMC) as deposited in PMC; Europe PMC's JATS XML, not the publisher's copy; read in full on 2026-11-12 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning 3dfeb6827620. Free to read (CC BY 2.0), checked 2026-11-12. No erratum found (searched crossref, europe-pmc, retraction-watch), 2026-11-12.

**Equation 4**

```equation
BEDROC = (RIE − RIE_min)/(RIE_max − RIE_min)
```

| Symbol | Meaning and unit |
| --- | --- |
| RIE | robust initial enhancement at the same alpha |
| RIE\_min | its smallest possible value for this n and N |
| RIE\_max | its largest possible value for this n and N |
| BEDROC | RIE rescaled to run from 0 to 1, returned as bedroc; undefined when n = N |

Source: Riniker S, Landrum GA, Open-source platform to benchmark fingerprints for ligand-based virtual screening, J Cheminform 5:26 (2013), equation 7, section Evaluation methods, Boltzmann-Enhanced Discrimination of ROC (BEDROC), version of record (BMC) as deposited in PMC; Europe PMC's JATS XML, not the publisher's copy; read in full on 2026-11-12 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning 3dfeb6827620. Free to read (CC BY 2.0), checked 2026-11-12. No erratum found (searched crossref, europe-pmc, retraction-watch), 2026-11-12.

### Constants

Constants: none used.

### Worked example

Worked example: one case of score-early-recognition\@2.0.0, from its inputs through each step to the answer. Values are written as a person writes them; the working carries more digits, so your own figure may differ in the last digit shown.

**Inputs**

- total = 10
- activeRanks.values\[0\] = 1
- activeRanks.values\[1\] = 3
- activeRanks.values\[2\] = 8
- activeRanks.unit = 1
- topCount = 3
- alpha = 2

**Steps**

1. activesInTop = 2, from activeRanks, topCount; by equation 1; gives activesInTop.
2. activeFraction = 0.3, from activeRanks, total; by equation 1.
3. ef = 2.2222222, from activesInTop, topCount, activeFraction; by equation 1; gives enrichmentFactor.
4. weightSum = 1.5694389, from activeRanks, total, alpha; by equation 2.
5. randomSum = 1.1716178, from activeFraction, alpha, total; by equation 2.
6. rie = 1.3395485, from weightSum, randomSum; by equation 2; gives robustInitialEnhancement.
7. rieMin = 0.42892032, from activeFraction, alpha; by equation 3.
8. rieMax = 1.7393577, from activeFraction, alpha; by equation 3.
9. bedroc = 0.69490403, from rie, rieMin, rieMax; by equation 4; gives bedroc.

The working, as the case writes it:

```equation
n = 3 actives among N = 10
2 of them rank in the top 3, so EF = (2/3)/(3/10) = 2.2222222
Σ e^(−α·r/N) = 0.81873075 + 0.54881164 + 0.20189652 = 1.5694389
the random sum (n/N)(1 − e^(−α))/(e^(α/N) − 1) = 1.1716178
RIE = 1.3395485
RIE_min = 0.42892032, RIE_max = 1.7393577
BEDROC = (1.3395485 − 0.42892032)/(1.7393577 − 0.42892032) = 0.69490403 (worked by hand by Drybench on 12 November 2026, the same author as this script)
```

**Answer**

- `activesInTop` = **2**
- `enrichmentFactor` = **2.2222222**
- `robustInitialEnhancement` = **1.3395485**
- `bedroc` = **0.69490403**

Where these values came from: our own exact-arithmetic script and a hand-worked case; stored reference values (fractions; 60-digit decimal exponentials).

At build the tool returned this answer within the tolerance the file states: the enrichment factor, RIE and BEDROC relative 1e-12, with a floor of 1e-15 below 1e-3; the count of actives in the top, statuses, codes, withholding rules and units exact.

Who worked this case: not recorded.

### What it refuses, and its input ranges

- `ALPHA_OUTSIDE_RANGE`: alpha is outside the range the method was checked over Next: Give an alpha inside the method's range, or leave alpha out and ask for the enrichment factor at a cut.
- `TOP_COUNT_OR_ALPHA_REQUIRED` (invalid input): neither a top count nor alpha is given: there is nothing to compute, and neither is ever defaulted
- `RANK_ABOVE_TOTAL` (invalid input): a rank is above the number of items in the list
- `DUPLICATE_RANK` (invalid input): two actives are given the same rank: ties are the caller's to break; checked at each rank after the whole-number and RANK\_ABOVE\_TOTAL checks
- `TOP_COUNT_ABOVE_TOTAL` (invalid input): the top count is above the number of items in the list

**Input ranges:** alpha: at least 1 and at most 500; outside it, refused (ALPHA\_OUTSIDE\_RANGE).

### Changes

#### 2026-11-14-score-early-recognition\@2.0.0-1

2026-11-14 · [`score-early-recognition@2.0.0`](https://www.drybench.com/methods/m/score-early-recognition) · Corrections to our methods

- **What was wrong:** BEDROC was formed as (RIE − RIE\_min)/(RIE\_max − RIE\_min), by subtraction. Near the bottom of its range the difference cancels: with the actives in the last ranks, where BEDROC is exactly 0, it was served as −2.2e-24, a value outside BEDROC's range of 0 to 1, and as noise of about 1e-24 in two other such cases. Near 0 the error is about 1e-16 of RIE's scale, so a small BEDROC carried a relative error far above the full double precision the record states.
- **Affected:** BEDROC in version 1.0.0, in every call with alpha; in its last bits on ordinary lists, and wholly at and near its exact 0. The enrichment factor and RIE are unchanged.
- **What changed:** In 2.0.0 BEDROC is formed as A/(A + B), two compensated sums of non-negative terms equal to Eq. 7 (the identity held against Eq. 7 at 60 digits on every case), so it lies between 0 and 1, is exactly 0 with the actives in the last ranks and exactly 1 with them in the first; each exponential's argument is carried beyond double precision. BEDROC moved in its last bits in twelve of the 1.0.0 cases; stored reference values is retired and records what 1.0.0 computed.
- **How it was found:** The D-0219 full check on 14 November 2026: a second implementation in Python by a separate agent of the same model family, at 60 digits or more, disagreed on three cases whose BEDROC is exactly 0 (finding PRS-F11); the CSO ruled it a correction.
- **Cases added:** stored reference values: the 1.0.0 cases re-recorded at 2.0.0 with RDKit 2026.03.6 checks, and three structural cases added (the actives in the last ranks, in the first, and one moved one place up from the bottom). stored reference values: 57 cases from the second implementation, every BEDROC at its exact 0 recorded as 0.

## Tools that use it

- [`score_early_recognition`](https://www.drybench.com/methods/tools/score-early-recognition)

## Cite this version

Enrichment factor, robust initial enhancement and BEDROC of a ranked list. Drybench; score-early-recognition\@2.0.0; [https://www.drybench.com/methods/m/score-early-recognition/2.0.0](https://www.drybench.com/methods/m/score-early-recognition/2.0.0) (accessed \[date\]).
