Data science/General Programming- How to make all combination of features ? : I am trying to generate all combination of features so that I can try all the combination to check which combination increased cross validation score. I am using this code which I used to do solve data structures problem.But it becomes highly inefficient if features >16 or so. Can you suggest something efficient ?

    allcomb=[]
    for i in range(pow(2,len(features))):
        com=[]
        for j in (range(len(features))):
            if((i&(1<<j))==1):
                com.append(features[j])
        allcomb.append(com)

