def findFinalActiveFeatures(self, intialActiveFeatures):
        finalActiveFeatures = []
        k = len(intialActiveFeatures)
        initialSet = set(intialActiveFeatures)

        if 2 ** k <= self.features_num:
            # k can be big which can cause this part to be very slow
            # if k is large then find active features by enumerating on the
            # discovered features.
            if self.use_chirstoph_ordered_features:
                for i in range(k, 0, -1):
                    if len(initialSet) == 0:
                        break
                    # generate list of all combinations with i elements
                    cand_i = [(c, self.iFDD_features[frozenset(c)].index)
                              for c in combinations(initialSet, i)
                              if frozenset(c) in self.iFDD_features]
                    # sort (recent features (big ids) first)
                    cand_i.sort(key=lambda x: x[1], reverse=True)
                    # idx = -1
                    for candidate, ind in cand_i:
                        # the next block is for testing only
                        # cur_idx = self.iFDD_features[frozenset(candidate)].index
                        # if idx > 0:
                        #    assert(idx > cur_idx)
                        # idx = cur_idx

                        if len(initialSet) == 0:
                            # No more initial features to be mapped to extended
                            # ones
                            break

                        # This was missing from ICML 2011 paper algorithm.
                        # Example: [0,1,20], [0,20] is discovered, but if [0]
                        # is checked before [1] it will be added even though it
                        # is already covered by [0,20]
                        if initialSet.issuperset(set(candidate)):
                            feature = self.iFDD_features.get(
                                frozenset(candidate))
                            if feature is not None:
                                finalActiveFeatures.append(feature.index)
                                if self.sparsify:
                                    # print "Sets:", initialSet, feature.f_set
                                    initialSet = initialSet - feature.f_set
                                    # print "Remaining Set:", initialSet
            else:
                for candidate in powerset(initialSet, ascending=0):
                    if len(initialSet) == 0:
                        # No more initial features to be mapped to extended
                        # ones
                        break

                    # This was missing from ICML 2011 paper algorithm. Example:
                    # [0,1,20], [0,20] is discovered, but if [0] is checked
                    # before [1] it will be added even though it is already
                    # covered by [0,20]
                    if initialSet.issuperset(set(candidate)):
                        feature = self.iFDD_features.get(frozenset(candidate))
                        if feature is not None:
                            finalActiveFeatures.append(feature.index)
                            if self.sparsify:
                                # print "Sets:", initialSet, feature.f_set
                                initialSet = initialSet - feature.f_set
                                # print "Remaining Set:", initialSet
        else:
            # print "********** Using Alternative: %d > %d" % (2**k, self.features_num)
            # Loop on all features sorted on their size and then novelty and
            # activate features
            for feature in self.sortediFDDFeatures.toList():
                if len(initialSet) == 0:
                    # No more initial features to be mapped to extended ones
                    break

                if initialSet.issuperset(set(feature.f_set)):
                    finalActiveFeatures.append(feature.index)
                    if self.sparsify:
                        # print "Sets:", initialSet, feature.f_set
                        initialSet = initialSet - feature.f_set
                        # print "Remaining Set:", initialSet

        if self.useCache:
            self.cache[frozenset(intialActiveFeatures)] = finalActiveFeatures
        return finalActiveFeatures
.. todo::
dataset/ETHPy150Open rlpy/rlpy/rlpy/Representations/iFDD.py/iFDD.findFinalActiveFeatures--crossover with--dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/sandbox/cuda_convnet/response_norm.py/local_crossmapnormundo_inplace