parameters: (self, support, indices=False)
return_statement: return self
docstring: Restrict the features to those in support using feature selection.
  
          This function modifies the estimator in-place.
  
          Parameters
          ----------
          support : array-like
              Boolean mask or list of indices (as returned by the get_support
              member of feature selectors).
          indices : boolean, optional
              Whether support is a list of indices.
  
          Returns
          -------
          self
  
          Examples
          --------
          >>> from sklearn.feature_extraction import DictVectorizer
          >>> from sklearn.feature_selection import SelectKBest, chi2
          >>> v = DictVectorizer()
          >>> D = [{'foo': 1, 'bar': 2}, {'foo': 3, 'baz': 1}]
          >>> X = v.fit_transform(D)
          >>> support = SelectKBest(chi2, k=2).fit(X, [0, 1])
          >>> v.get_feature_names()
          ['bar', 'baz', 'foo']
          >>> v.restrict(support.get_support())
          DictVectorizer()
          >>> v.get_feature_names()
          ['bar', 'foo']
docstring_summary: Restrict the features to those in support using feature selection.
docstring_tokens: Restrict the features to those in support using feature selection .
function: def restrict(self, support, indices=False):
          """Restrict the features to those in support using feature selection.
  
          This function modifies the estimator in-place.
  
          Parameters
          ----------
          support : array-like
              Boolean mask or list of indices (as returned by the get_support
              member of feature selectors).
          indices : boolean, optional
              Whether support is a list of indices.
  
          Returns
          -------
          self
  
          Examples
          --------
          >>> from sklearn.feature_extraction import DictVectorizer
          >>> from sklearn.feature_selection import SelectKBest, chi2
          >>> v = DictVectorizer()
          >>> D = [{'foo': 1, 'bar': 2}, {'foo': 3, 'baz': 1}]
          >>> X = v.fit_transform(D)
          >>> support = SelectKBest(chi2, k=2).fit(X, [0, 1])
          >>> v.get_feature_names()
          ['bar', 'baz', 'foo']
          >>> v.restrict(support.get_support())
          DictVectorizer()
          >>> v.get_feature_names()
          ['bar', 'foo']
          """
          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(new_vocab.items(),
                                                      key=itemgetter(1))]
  
          return self
function_tokens: 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 ( new_vocab . items ( ) , key = itemgetter ( 1 ) ) ] return self