lundi 26 juillet 2021

Is there any way to make sure 100% that sum of all probability passed to np.random.choice = 100?

I'm having 50000 samples that each has a probability, so each probability is very small. I has error probability sum isn't 1 of np.random.choice, and has tried a lot of way to fix it: convert to float64, try to assign first probability = 1- the rest, try to normalize by let all probability/ np.sum([list of all probability]), but once in a while this still happen, since i change the list of probability regularly. Anyone know how to fix this?




Aucun commentaire:

Enregistrer un commentaire