rgcca-factory / RGCCA

https://rgcca-factory.github.io/RGCCA/
10 stars 11 forks source link

Option to pass at rgcca_predict to get class predicted probabilities #79

Open tonyliang19 opened 4 months ago

tonyliang19 commented 4 months ago

Hello, I was testing the rgcca_predict functionality with my data on classifcation problem. I think it's very awesome to just have a string to change the underlying model to use. But I noticed the returned output is simply just the predicted class and not the probabilities itself.

So, I wonder if you have implemented a way that you just pass like an additional parameter to your rgcca_predict like a normal S3 predict(..., type = "probs"), whereas you could pass that type arg to return either probability or link function output etc. Thanks!

GFabien commented 4 months ago

Hi @tonyliang19! Thank you for your message. Would you prefer a new argument type to change the prediction output into probabilities, or would a new output probs with the probabilities when relevant or empty otherwise be enough? We might be a bit far from the regular S3 predict for the 1st option. What do you think?

tonyliang19 commented 4 months ago

Hi @tonyliang19! Thank you for your message. Would you prefer a new argument type to change the prediction output into probabilities, or would a new output probs with the probabilities when relevant or empty otherwise be enough? We might be a bit far from the regular S3 predict for the 1st option. What do you think?

Thanks for your consideration on this matter, I would say if the first option deviates a lot from regular S3 predict, then adding a new output probs would be adequate and enough. As it complements by your other standard output of a rgcca predict.

GFabien commented 4 months ago

You can try the branch: https://github.com/rgcca-factory/RGCCA/tree/add_probs_in_predict; we'll merge it if it suits your needs!

tonyliang19 commented 4 months ago

Amazing, I will try this as soon as possible and you let you know!

tonyliang19 commented 4 months ago

You can try the branch: https://github.com/rgcca-factory/RGCCA/tree/add_probs_in_predict; we'll merge it if it suits your needs!

Thats exactly what I needed! I liked that you provided the probability for each class predicted. This works for now, although I have not tested with the case of multi-class classifications. Again, thanks for you work on this