I want to generate a binary label systematically and I hope I can generate a three or four labels later, if my first analysis worked well.
Here is the code to make the binary label combinations:
lst = sorted([i for i in itertools.product([1, 0], repeat=len(my_data))], key=sum)
The above code worked well if the samples to add labels were small like N = 5. However, if N is greater than 20 or so, I do get an error assuming due to a memory error.
Thus, I had to change my strategy and although this is not an ideal method, I found the other way to go from SO. Generate all binary strings of length n with k bits set
However, I then faced on a different problem. The data format I want to save for future use is like 1,1,1,1 or 0,1,0,1, not 1110 or 0101.
I guess I can modify the pseudo labels to be a comma separated by using awk after saved but it should be of great if I can convert the format as comma separated in python before saving for the convenience.
Your suggestions for both itertools.product and comma separation are greatly appreciated.