class_docstr: Convert a collection of raw documents to a matrix of TF-IDF features.
  
  Equivalent to :class:`CountVectorizer` followed by
  :class:`TfidfTransformer`.
  
  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'}, default='word'
      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.
  norm : {'l1', 'l2'}, default='l2'
      Each output row will have unit norm, either:
       * 'l2': Sum of squares of vector elements is 1. The cosine similarity
         between two vectors is their dot product when l2 norm has been
         applied.
       * 'l1': Sum of absolute values of vector elements is 1.
  
  use_idf : bool, default=True
      Enable inverse-document-frequency reweighting.
  smooth_idf : bool, default=True
      Smooth idf weights by adding one to document frequencies, as if an
      extra document was seen containing every term in the collection
      exactly once. Prevents zero divisions.
  sublinear_tf : bool, default=False
      Apply sublinear tf scaling, i.e. replace tf with 1 + log(tf).
  
  Attributes
  ----------
  idf_ : array of shape (n_features)
      The inverse document frequency (IDF) vector; only defined
      if  `use_idf` is True.
  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.
  
  Notes
  -----
  The ``stop_words_`` attribute can get large and increase the model size
  when pickling. This attribute is provided only for introspection and can
  be safely removed using delattr or set to None before pickling.
  
  This class is largely based on scikit-learn 0.23.1's TfIdfVectorizer code,
  which is provided under the BSD-3 license.
class_docstr_tok: ["Convert","a","collection","of","raw","documents","to","a","matrix","of","TF-IDF","features",".","Equivalent","to",":","class",":","`","CountVectorizer","`","followed","by",":","class",":","`","TfidfTransformer","`",".","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","'","}",",","default='word'","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",".","norm",":","{","'l1","'",",","'l2","'","}",",","default='l2'","Each","output","row","will","have","unit","norm",",","either",":","*","'l2","'",":","Sum","of","squares","of","vector","elements","is","1",".","The","cosine","similarity","between","two","vectors","is","their","dot","product","when","l2","norm","has","been","applied",".","*","'l1","'",":","Sum","of","absolute","values","of","vector","elements","is","1.","use_idf",":","bool",",","default=True","Enable","inverse-document-frequency","reweighting",".","smooth_idf",":","bool",",","default=True","Smooth","idf","weights","by","adding","one","to","document","frequencies",",","as","if","an","extra","document","was","seen","containing","every","term","in","the","collection","exactly","once",".","Prevents","zero","divisions",".","sublinear_tf",":","bool",",","default=False","Apply","sublinear","tf","scaling",",","i.e",".","replace","tf","with","1","+","log","(","tf",")",".","Attributes","--","--","--","--","--","idf_",":","array","of","shape","(","n_features",")","The","inverse","document","frequency","(","IDF",")","vector",";","only","defined","if","`","use_idf","`","is","True",".","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",".","Notes","--","--","-","The","``","stop_words_","``","attribute","can","get","large","and","increase","the","model","size","when","pickling",".","This","attribute","is","provided","only","for","introspection","and","can","be","safely","removed","using","delattr","or","set","to","None","before","pickling",".","This","class","is","largely","based","on","scikit-learn","0.23.1","'s","TfIdfVectorizer","code",",","which","is","provided","under","the","BSD-3","license","."]
docstr: Learn vocabulary and idf from training set.
  
  Parameters
  ----------
  raw_documents : cudf.Series or pd.Series
     A Series of string documents
  
  Returns
  -------
  self : object
      Fitted vectorizer.
docstr_tok: ["Learn","vocabulary","and","idf","from","training","set",".","Parameters","--","--","--","--","--","raw_documents",":","cudf.Series","or","pd.Series","A","Series","of","string","documents","Returns","--","--","--","-","self",":","object","Fitted","vectorizer","."]
code: def fit(self, raw_documents):
      """Learn vocabulary and idf from training set.
  
      Parameters
      ----------
      raw_documents : cudf.Series or pd.Series
         A Series of string documents
  
      Returns
      -------
      self : object
          Fitted vectorizer.
      """
      X = super().fit_transform(raw_documents)
      self._tfidf.fit(X)
      return self
  
file_path: cuml/python/cuml/feature_extraction/_tfidf_vectorizer.py
imports: from cuml.feature_extraction._vectorizers import CountVectorizer
  from cuml.feature_extraction._tfidf import TfidfTransformer
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 12 for calling the TfidfVectorizer obj's underlying member method code with example usage: obj.fit(raw_documents) and returns: self