Jfortin1/neuroCombat

invalid value encountered in divide

Opened this issue · 2 comments

Hi @Jfortin1!
Happy to greet you! First of all, thank you very much for your contributions in the field of harmonization!

I'm trying to use neuroHarmonize that run over combat, but I have an error that I've seen that you have solved before:
image
I've tried to modify the combat.py code but I can't get the whole implementation to work.
Could you indicate me which lines of code should I modify please?
The problem is in line 190 in harmonizationLearn.py
image

Thank you very much in advance!!

Hello, I also encountered the same problem. Have you solved it?
image
This is my final output
image
Thank you very much in advance!!

I just encountered this and figured out what was causing it for me. My batch col had 3 levels in it - I coincidentally had only n=1 for the 3rd label, so temporarily set it to 2 instead of 3 and the program worked successfully. Will need to dig into why that is exactly and how to work around it in the future but for now I'll just go down to 2 levels.