You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for i in range(numMol):
if i > (numPerFrac[0] - 1) and i > 0:
enrich.append(1.0 * numActives * numMol / i)
numPerFrac.pop(0)
active = scores[i][col]
if active:
numActives += 1
if numActives > 0: # check that there are actives
enrich = [e / numActives for e in enrich]
For code above, numActives is 2, but enrich list is empty. This results in empty list comprehension, and returning an empty list.
Expected behavior
Maybe an error? Or zero value. However, even for those weird values there should be some enrichment, since a single active was found.
Configuration (please complete the following information):
RDKit version: 2024.3.3
OS: Ubuntu 24.04
Python version (if relevant): 3.9.20
Are you using conda? no
If you are not using conda: how did you install the RDKit? pip
The text was updated successfully, but these errors were encountered:
Describe the bug
Enrichment factor function
CalcEnrichment
returns empty list, when it should return something, e.g. raise error, or return 0.To Reproduce
Note: of course those values and fraction 0.9 make no particular sense. This was discovered when writing tests for edge cases.
The code returns an empty list, i.e.
e = []
.I suspect this part here
rdkit/rdkit/ML/Scoring/Scoring.py
Line 159 in b16b602
For code above,
numActives
is 2, butenrich
list is empty. This results in empty list comprehension, and returning an empty list.Expected behavior
Maybe an error? Or zero value. However, even for those weird values there should be some enrichment, since a single active was found.
Configuration (please complete the following information):
The text was updated successfully, but these errors were encountered: