mardi 21 novembre 2017

Random Sampling with different probabilities

i'm pretty new to python and maybe this is a very silly/stupid question, but i've got a tremendous headache from thinking about this problem.

I got a set of data, for example integers, from which i want to extract a random subset, but every object has a different probability. How can i extract the subset in a way that respect the probability distribution of the data?

I suppose that np.random_sample gives to all samples the same priority, so its not what i'm looking for...




Aucun commentaire:

Enregistrer un commentaire