lcmmichielsen / scHPL

MIT License
34 stars 1 forks source link

Output probability for each class #9

Closed alvaannett closed 10 months ago

alvaannett commented 1 year ago

Hello,

Is there a way to output the probability for each cell to belong to each class?

Best, Alva

lcmmichielsen commented 1 year ago

Hi Alva,

This is not possible yet, but I can add this option in the coming weeks.

Cheers, Lieke

alvaannett commented 1 year ago

Thank you, that would be great! :)

Best, Alva

lcmmichielsen commented 10 months ago

Sorry for the late reply! I just implemented the possibility of returning the probabilities. You can download this version from the pip repository. This only works when using the kNN classifier though (the linear and one-class SVM in sklearn only returns a score instead of a probability). You can get the probabilities by running the following:

y_pred, y_prob = predict.predict_labels(testdata,tree)

Hope this helps!

alvaannett commented 9 months ago

Thank you so much! :)