class_docstr: Transform a count matrix to a normalized tf or tf-idf representation
  Tf means term-frequency while tf-idf means term-frequency times inverse
  document-frequency. This is a common term weighting scheme in information
  retrieval, that has also found good use in document classification.
  The goal of using tf-idf instead of the raw frequencies of occurrence of a
  token in a given document is to scale down the impact of tokens that occur
  very frequently in a given corpus and that are hence empirically less
  informative than features that occur in a small fraction of the training
  corpus.
  The formula that is used to compute the tf-idf for a term t of a document d
  in a document set is tf-idf(t, d) = tf(t, d) * idf(t), and the idf is
  computed as idf(t) = log [ n / df(t) ] + 1 (if ``smooth_idf=False``), where
  n is the total number of documents in the document set and df(t) is the
  document frequency of t; the document frequency is the number of documents
  in the document set that contain the term t. The effect of adding "1" to
  the idf in the equation above is that terms with zero idf, i.e., terms
  that occur in all documents in a training set, will not be entirely
  ignored.
  (Note that the idf formula above differs from the standard textbook
  notation that defines the idf as
  idf(t) = log [ n / (df(t) + 1) ]).
  If ``smooth_idf=True`` (the default), the constant "1" is added to the
  numerator and denominator of the idf as if an extra document was seen
  containing every term in the collection exactly once, which prevents
  zero divisions: idf(t) = log [ (1 + n) / (1 + df(t)) ] + 1.
  Furthermore, the formulas used to compute tf and idf depend
  on parameter settings that correspond to the SMART notation used in IR
  as follows:
  Tf is "n" (natural) by default, "l" (logarithmic) when
  ``sublinear_tf=True``.
  Idf is "t" when use_idf is given, "n" (none) otherwise.
  Normalization is "c" (cosine) when ``norm='l2'``, "n" (none)
  when ``norm=None``.
  
  Parameters
  ----------
  
  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).
  handle : cuml.Handle
      Specifies the cuml.handle that holds internal CUDA state for
      computations in this model. Most importantly, this specifies the CUDA
      stream that will be used for the model's computations, so users can
      run different models concurrently in different streams by creating
      handles in several streams.
      If it is None, a new one is created.
  verbose : int or boolean, default=False
      Sets logging level. It must be one of `cuml.common.logger.level_*`.
      See :ref:`verbosity-levels` for more info.
  output_type : {'input', 'array', 'dataframe', 'series', 'df_obj',         'numba', 'cupy', 'numpy', 'cudf', 'pandas'}, default=None
      Return results and set estimator attributes to the indicated output
      type. If None, the output type set at the module level
      (`cuml.global_settings.output_type`) will be used. See
      :ref:`output-data-type-configuration` for more info.
  
  Attributes
  ----------
  idf_ : array of shape (n_features)
      The inverse document frequency (IDF) vector; only defined
      if ``use_idf`` is True.
class_docstr_tok: ["Transform","a","count","matrix","to","a","normalized","tf","or","tf-idf","representation","Tf","means","term-frequency","while","tf-idf","means","term-frequency","times","inverse","document-frequency",".","This","is","a","common","term","weighting","scheme","in","information","retrieval",",","that","has","also","found","good","use","in","document","classification",".","The","goal","of","using","tf-idf","instead","of","the","raw","frequencies","of","occurrence","of","a","token","in","a","given","document","is","to","scale","down","the","impact","of","tokens","that","occur","very","frequently","in","a","given","corpus","and","that","are","hence","empirically","less","informative","than","features","that","occur","in","a","small","fraction","of","the","training","corpus",".","The","formula","that","is","used","to","compute","the","tf-idf","for","a","term","t","of","a","document","d","in","a","document","set","is","tf-idf","(","t",",","d",")","=","tf","(","t",",","d",")","*","idf","(","t",")",",","and","the","idf","is","computed","as","idf","(","t",")","=","log","[","n","\/","df","(","t",")","]","+","1","(","if","``","smooth_idf=False","``",")",",","where","n","is","the","total","number","of","documents","in","the","document","set","and","df","(","t",")","is","the","document","frequency","of","t",";","the","document","frequency","is","the","number","of","documents","in","the","document","set","that","contain","the","term","t.","The","effect","of","adding","``","1","''","to","the","idf","in","the","equation","above","is","that","terms","with","zero","idf",",","i.e.",",","terms","that","occur","in","all","documents","in","a","training","set",",","will","not","be","entirely","ignored",".","(","Note","that","the","idf","formula","above","differs","from","the","standard","textbook","notation","that","defines","the","idf","as","idf","(","t",")","=","log","[","n","\/","(","df","(","t",")","+","1",")","]",")",".","If","``","smooth_idf=True","``","(","the","default",")",",","the","constant","``","1","''","is","added","to","the","numerator","and","denominator","of","the","idf","as","if","an","extra","document","was","seen","containing","every","term","in","the","collection","exactly","once",",","which","prevents","zero","divisions",":","idf","(","t",")","=","log","[","(","1","+","n",")","\/","(","1","+","df","(","t",")",")","]","+","1",".","Furthermore",",","the","formulas","used","to","compute","tf","and","idf","depend","on","parameter","settings","that","correspond","to","the","SMART","notation","used","in","IR","as","follows",":","Tf","is","``","n","''","(","natural",")","by","default",",","``","l","''","(","logarithmic",")","when","``","sublinear_tf=True","``",".","Idf","is","``","t","''","when","use_idf","is","given",",","``","n","''","(","none",")","otherwise",".","Normalization","is","``","c","''","(","cosine",")","when","``","norm='l2","'","``",",","``","n","''","(","none",")","when","``","norm=None","``",".","Parameters","--","--","--","--","--","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",")",".","handle",":","cuml.Handle","Specifies","the","cuml.handle","that","holds","internal","CUDA","state","for","computations","in","this","model",".","Most","importantly",",","this","specifies","the","CUDA","stream","that","will","be","used","for","the","model","'s","computations",",","so","users","can","run","different","models","concurrently","in","different","streams","by","creating","handles","in","several","streams",".","If","it","is","None",",","a","new","one","is","created",".","verbose",":","int","or","boolean",",","default=False","Sets","logging","level",".","It","must","be","one","of","`","cuml.common.logger.level_","*","`",".","See",":","ref",":","`","verbosity-levels","`","for","more","info",".","output_type",":","{","'input","'",",","'array","'",",","'dataframe","'",",","'series","'",",","'df_obj","'",",","'numba","'",",","'cupy","'",",","'numpy","'",",","'cudf","'",",","'pandas","'","}",",","default=None","Return","results","and","set","estimator","attributes","to","the","indicated","output","type",".","If","None",",","the","output","type","set","at","the","module","level","(","`","cuml.global_settings.output_type","`",")","will","be","used",".","See",":","ref",":","`","output-data-type-configuration","`","for","more","info",".","Attributes","--","--","--","--","--","idf_",":","array","of","shape","(","n_features",")","The","inverse","document","frequency","(","IDF",")","vector",";","only","defined","if","``","use_idf","``","is","True","."]
code: def idf_(self):
      # if _idf_diag is not set, this will raise an attribute error,
      # which means hasattr(self, "idf_") is False
      return self._idf_diag.data
  
imports: from cuml import Base
  from cuml.internals.array import CumlArray
  from cuml.common.sparsefuncs import csr_diag_mul
  from cuml.common.sparsefuncs import csr_row_normalize_l1, csr_row_normalize_l2
  import cuml.internals
  from cuml.common.exceptions import NotFittedError
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 9 for calling the TfidfTransformer obj's underlying member method code with example usage: obj.idf_() and returns: self