def restrict(self, support, indices=False):
        if not indices:
            support = np.where(support)[0]

        names = self.feature_names_
        new_vocab = {}
        for i in support:
            new_vocab[names[i]] = len(new_vocab)

        self.vocabulary_ = new_vocab
        self.feature_names_ = [f for f, i in sorted(six.iteritems(new_vocab),
                                                    key=itemgetter(1))]

        return self
Restrict the features to those in support using feature selection.
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/feature_extraction/dict_vectorizer.py/DictVectorizer.restrict