-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
When using map.run_pipeline(), if some samples are only present once in the dataset compute.ap_contiguos returns zeros. This is due to compute.to_cutoffs being applied to an array of length 1, so the line in
copairs/src/copairs/compute.py
Line 171 in 491ebaf
| cutoffs[0], cutoffs[1:] = 0, counts.cumsum()[:-1] |
These 0s are propagated to num_pos
copairs/src/copairs/compute.py
Line 97 in 491ebaf
| num_pos = np.add.reduceat(rel_k_list, cutoffs) |
copairs/src/copairs/compute.py
Line 105 in 491ebaf
| ap_scores = np.add.reduceat(pr_k * rel_k_list, cutoffs) / num_pos |
It was a bit puzzling to figure out why my test with a small number of plates was plagued with nans, so it is probably worth adding a warning when 1 (or maybe a fraction, i.e., 1/4) of all elements appear only once.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working