Closed Hrovatin closed 2 years ago
Hey! We've seen this occasionally as well, but it was typically not reproducible and seemed to be due to a numerical issue. Do you have a reproducible example? Also, what do you mean by "lisi" in your nBatches<lisi?
I was referring to lisi in https://github.com/theislab/scib/blob/172f181b3e0e6118e956510725755f9a7c1aeab0/scib/metrics/lisi.py#L700
@soroorh Could you try to rerun this metric on the specific dataset to see if it happens again?
Done. We still get a negative value, i'm afraid. In this case, there are only 2 batches, so my impression is that the numerator is negative.
@LuckyMD any ideas?
Ah... could it be that you have n_cell_types > n_batches? I think this is a bug from treating ilisi and clisi together the whole time. This should be (n_cell_types - clisi_score) / (n_batches - 1)
to have the correct upper limit.
The only thing that needs to be adapted is: https://github.com/theislab/scib/blob/172f181b3e0e6118e956510725755f9a7c1aeab0/scib/metrics/lisi.py#L300
batch_key
-> label_key
The part you reference above is deprecated anyway
Hey you guys! You can pull from #287 if you want. The test pipeline values still need to be adapted for this to be merged. That's sth @mumichae set up, so I would prefer to wait for her to adapt those. But technically this should fix it.
all good. confirm it's now fixed. thanks heaps, Malte!
Adapted testing and merged now as well. You can use master branch then. Thanks for bringing this up!
We got negative cLISi score. This could happen if nBatches<lisi. Any ideas why this could be the case in our data (we had recomputed neighbours before running it). @soroorh