@karlnapf max number of subsets at any time will be equal to the max depth of our decision tree (<= num_features). So, it can be quite high depending on dataset (few hundreds I am guessing!). Is there an upper limit to the stack size for subsets?

I cross-checked subset things with documentation. There shouldn't be any error. Plus, unit-test added by me is passing. The solution is indeed more elegant with subsets. I didn't know about this feature before. :)