dimanche 24 novembre 2019

Choose One Item from Every List, up to N combination, uniform distribution

I have 100 lists [x1..x100] , each one containing about 10 items. [x_i_1,...x_i_10] I need to generate 80 vectors. Each vector is a production of all the lists, kind of like itertools.product(*x), except 2 things:

(1) I need every item in each vector to have a uniform distribution. for example: [ np.random.choice(xi) for xi in [x1..x100]] would be good, except for my seconds condition:

(2) i can't have repetitions. itertools.product solves this, but it doesn't meet condition (1).

I need to generate 80 vectors, use them, and re-ask for another 80, and repeat this process until a certain condition is met. for EACH vector across all 80-size-batch, i need them to be uniform (condition 1) and non repeating (condition 2)

Creating all permutations and shuffling that list is a great solution for a smaller list, I'm using this batch system because of the HUGE number of possible permutations

Any ideas? thx




Aucun commentaire:

Enregistrer un commentaire