class_docstr: Convert a collection of text documents to a matrix of token counts
  
  If you do not provide an a-priori dictionary then the number of features
  will be equal to the vocabulary size found by analyzing the data.
  
  Parameters
  ----------
  lowercase : boolean, True by default
      Convert all characters to lowercase before tokenizing.
  preprocessor : callable or None (default)
      Override the preprocessing (string transformation) stage while
      preserving the tokenizing and n-grams generation steps.
  stop_words : string {'english'}, list, or None (default)
      If 'english', a built-in stop word list for English is used.
      If a list, that list is assumed to contain stop words, all of which
      will be removed from the input documents.
      If None, no stop words will be used. max_df can be set to a value
      to automatically detect and filter stop words based on intra corpus
      document frequency of terms.
  ngram_range : tuple (min_n, max_n), default=(1, 1)
      The lower and upper boundary of the range of n-values for different
      word n-grams or char n-grams to be extracted. All values of n such
      such that min_n <= n <= max_n will be used. For example an
      ``ngram_range`` of ``(1, 1)`` means only unigrams, ``(1, 2)`` means
      unigrams and bigrams, and ``(2, 2)`` means only bigrams.
  analyzer : string, {'word', 'char', 'char_wb'}
      Whether the feature should be made of word n-gram or character
      n-grams.
      Option 'char_wb' creates character n-grams only from text inside
      word boundaries; n-grams at the edges of words are padded with space.
  max_df : float in range [0.0, 1.0] or int, default=1.0
      When building the vocabulary ignore terms that have a document
      frequency strictly higher than the given threshold (corpus-specific
      stop words).
      If float, the parameter represents a proportion of documents, integer
      absolute counts.
      This parameter is ignored if vocabulary is not None.
  min_df : float in range [0.0, 1.0] or int, default=1
      When building the vocabulary ignore terms that have a document
      frequency strictly lower than the given threshold. This value is also
      called cut-off in the literature.
      If float, the parameter represents a proportion of documents, integer
      absolute counts.
      This parameter is ignored if vocabulary is not None.
  max_features : int or None, default=None
      If not None, build a vocabulary that only consider the top
      max_features ordered by term frequency across the corpus.
      This parameter is ignored if vocabulary is not None.
  vocabulary : cudf.Series, optional
      If not given, a vocabulary is determined from the input documents.
  binary : boolean, default=False
      If True, all non zero counts are set to 1. This is useful for discrete
      probabilistic models that model binary events rather than integer
      counts.
  dtype : type, optional
      Type of the matrix returned by fit_transform() or transform().
  delimiter : str, whitespace by default
      String used as a replacement for stop words if stop_words is not None.
      Typically the delimiting character between words is a good choice.
  
  Attributes
  ----------
  vocabulary_ : cudf.Series[str]
      Array mapping from feature integer indices to feature name.
  stop_words_ : cudf.Series[str]
      Terms that were ignored because they either:
        - occurred in too many documents (`max_df`)
        - occurred in too few documents (`min_df`)
        - were cut off by feature selection (`max_features`).
  
      This is only available if no vocabulary was given.
class_docstr_tok: ["Convert","a","collection","of","text","documents","to","a","matrix","of","token","counts","If","you","do","not","provide","an","a-priori","dictionary","then","the","number","of","features","will","be","equal","to","the","vocabulary","size","found","by","analyzing","the","data",".","Parameters","--","--","--","--","--","lowercase",":","boolean",",","True","by","default","Convert","all","characters","to","lowercase","before","tokenizing",".","preprocessor",":","callable","or","None","(","default",")","Override","the","preprocessing","(","string","transformation",")","stage","while","preserving","the","tokenizing","and","n-grams","generation","steps",".","stop_words",":","string","{","'english","'","}",",","list",",","or","None","(","default",")","If","'english","'",",","a","built-in","stop","word","list","for","English","is","used",".","If","a","list",",","that","list","is","assumed","to","contain","stop","words",",","all","of","which","will","be","removed","from","the","input","documents",".","If","None",",","no","stop","words","will","be","used",".","max_df","can","be","set","to","a","value","to","automatically","detect","and","filter","stop","words","based","on","intra","corpus","document","frequency","of","terms",".","ngram_range",":","tuple","(","min_n",",","max_n",")",",","default=","(","1",",","1",")","The","lower","and","upper","boundary","of","the","range","of","n-values","for","different","word","n-grams","or","char","n-grams","to","be","extracted",".","All","values","of","n","such","such","that","min_n","<","=","n","<","=","max_n","will","be","used",".","For","example","an","``","ngram_range","``","of","``","(","1",",","1",")","``","means","only","unigrams",",","``","(","1",",","2",")","``","means","unigrams","and","bigrams",",","and","``","(","2",",","2",")","``","means","only","bigrams",".","analyzer",":","string",",","{","'word","'",",","'char","'",",","'char_wb","'","}","Whether","the","feature","should","be","made","of","word","n-gram","or","character","n-grams",".","Option","'char_wb","'","creates","character","n-grams","only","from","text","inside","word","boundaries",";","n-grams","at","the","edges","of","words","are","padded","with","space",".","max_df",":","float","in","range","[","0.0",",","1.0","]","or","int",",","default=1.0","When","building","the","vocabulary","ignore","terms","that","have","a","document","frequency","strictly","higher","than","the","given","threshold","(","corpus-specific","stop","words",")",".","If","float",",","the","parameter","represents","a","proportion","of","documents",",","integer","absolute","counts",".","This","parameter","is","ignored","if","vocabulary","is","not","None",".","min_df",":","float","in","range","[","0.0",",","1.0","]","or","int",",","default=1","When","building","the","vocabulary","ignore","terms","that","have","a","document","frequency","strictly","lower","than","the","given","threshold",".","This","value","is","also","called","cut-off","in","the","literature",".","If","float",",","the","parameter","represents","a","proportion","of","documents",",","integer","absolute","counts",".","This","parameter","is","ignored","if","vocabulary","is","not","None",".","max_features",":","int","or","None",",","default=None","If","not","None",",","build","a","vocabulary","that","only","consider","the","top","max_features","ordered","by","term","frequency","across","the","corpus",".","This","parameter","is","ignored","if","vocabulary","is","not","None",".","vocabulary",":","cudf.Series",",","optional","If","not","given",",","a","vocabulary","is","determined","from","the","input","documents",".","binary",":","boolean",",","default=False","If","True",",","all","non","zero","counts","are","set","to","1",".","This","is","useful","for","discrete","probabilistic","models","that","model","binary","events","rather","than","integer","counts",".","dtype",":","type",",","optional","Type","of","the","matrix","returned","by","fit_transform","(",")","or","transform","(",")",".","delimiter",":","str",",","whitespace","by","default","String","used","as","a","replacement","for","stop","words","if","stop_words","is","not","None",".","Typically","the","delimiting","character","between","words","is","a","good","choice",".","Attributes","--","--","--","--","--","vocabulary_",":","cudf.Series","[","str","]","Array","mapping","from","feature","integer","indices","to","feature","name",".","stop_words_",":","cudf.Series","[","str","]","Terms","that","were","ignored","because","they","either",":","-","occurred","in","too","many","documents","(","`","max_df","`",")","-","occurred","in","too","few","documents","(","`","min_df","`",")","-","were","cut","off","by","feature","selection","(","`","max_features","`",")",".","This","is","only","available","if","no","vocabulary","was","given","."]
docstr: Remove too rare or too common features.
  
  Prune features that are non zero in more samples than high or less
  documents than low, modifying the vocabulary, and restricting it to
  at most the limit most frequent.
  
  Sets `self.vocabulary_` and `self.stop_words_` with the new values.
docstr_tok: ["Remove","too","rare","or","too","common","features",".","Prune","features","that","are","non","zero","in","more","samples","than","high","or","less","documents","than","low",",","modifying","the","vocabulary",",","and","restricting","it","to","at","most","the","limit","most","frequent",".","Sets","`","self.vocabulary_","`","and","`","self.stop_words_","`","with","the","new","values","."]
code: def _limit_features(self, count_df, vocab, high, low, limit):
      """
      Remove too rare or too common features.
  
      Prune features that are non zero in more samples than high or less
      documents than low, modifying the vocabulary, and restricting it to
      at most the limit most frequent.
  
      Sets `self.vocabulary_` and `self.stop_words_` with the new values.
      """
      if high is None and low is None and limit is None:
          self.stop_words_ = None
          return count_df
  
      document_frequency = _document_frequency(count_df)
  
      mask = cp.ones(len(document_frequency), dtype=bool)
      if high is not None:
          mask &= document_frequency <= high
      if low is not None:
          mask &= document_frequency >= low
      if limit is not None and mask.sum() > limit:
          term_frequency = _term_frequency(count_df)
          mask_inds = (-term_frequency[mask]).argsort()[:limit]
          new_mask = cp.zeros(len(document_frequency), dtype=bool)
          new_mask[cp.where(mask)[0][mask_inds]] = True
          mask = new_mask
  
      keep_idx = cp.where(mask)[0].astype(cp.int32)
      keep_num = keep_idx.shape[0]
  
      if keep_num == 0:
          raise ValueError(
              "After pruning, no terms remain. Try a lower"
              " min_df or a higher max_df."
          )
  
      if len(vocab) - keep_num != 0:
          count_df = self._filter_and_renumber(
              count_df, keep_idx, "token"
          )
  
      self.stop_words_ = vocab[~mask].reset_index(drop=True)
      self.vocabulary_ = vocab[mask].reset_index(drop=True)
  
      return count_df
  
imports: from cuml.internals.safe_imports import cpu_only_import
  import cuml.internals.logger
  from cudf.utils.dtypes import min_signed_type
  from cuml.internals.type_utils import CUPY_SPARSE_DTYPES
  import numbers
  from cuml.internals.safe_imports import gpu_only_import
  from functools import partial
  from cuml.common.sparsefuncs import create_csr_matrix_from_count_df
  from cuml.common.sparsefuncs import csr_row_normalize_l1, csr_row_normalize_l2
  from cuml.feature_extraction._stop_words import ENGLISH_STOP_WORDS
  from cuml.common.exceptions import NotFittedError
  from cuml.internals.safe_imports import gpu_only_import_from
label_desc: Use image node_id 4 for calling the CountVectorizer obj's underlying member method code with example usage: obj._limit_features(count_df, vocab, high, low, limit) and returns: count_df, count_df