Posterior probability interpretability (soft=True)

Hello,

I used scANVI to transfer cell type labels from a single-cell reference to my spatial transcriptomics data (MERFISH).

I assigned labels at three hierarchical levels and then compared the prediction scores obtained with the .predict(..., soft=True) function.

  • At the family level (e.g., ET, IT, GABA in the cortex), the scores are almost all close to 0.

  • At the supertype level (e.g., L4 ITs, Pvalbs, etc.), the results look much better, with most cells having scores close to 1.

I would have expected the family level—being more general—to yield stronger prediction scores than the more specific supertype level.

I searched GitHub issues and only found the following reference:

My questions are:

  1. Can these scores be used for filtering?

  2. Should I trust them as an indicator of assignment confidence?

  3. Could you explain how the scores are actually calculated? I read the description in the paper, but I’m not sure I fully understood it.

Thanks a lot for your help!

Hey,

  1. They can be used as filtering, but first you will have to prove for yourself that your model is good, so you will likely need to do some kind of validation for your model (like put some data aside, train the model, and check that the predicted labels on the left aside data are good, i.e., match the ground truth, with any kind of classification metrics)
  2. As Martin suggested, they are not well calibrated so I cant say for 100% they are source of confidence (you can run a bootstrap to prove for yourself)
  3. It uses a softmax layer in as the final activation at the end of the NN model, and converts the logits into the predicted probability to be assigned to any of the given class labels (probability distribution over all classes).

See more on SCANVI tutorials:

for example:

BTW,

I would suggest that you check out our new spatial model that might help in your case (see RESOLVI and scVIVA)