class_docstr: Supervised method (supports ONLY binary classification) 
  transform a count matrix to a normalized Tfrf representation
  Tf means term-frequency while RF means relevance frequency.
  Parameters
  ----------
  norm : 'l1', 'l2', 'max' or None, optional
      Norm used to normalize term vectors. None for no normalization.
  smooth_df : boolean or int, default=True
      Smooth df 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 : boolean, default=False
      Apply sublinear tf scaling, i.e. replace tf with 1 + log(tf).
  References
  ----------
  .. [M. Lan, C. L. Tan, J. Su, and Y. Lu] `Supervised and traditional 
              term weighting methods for automatic text categorization`
class_docstr_tok: ["Supervised","method","(","supports","ONLY","binary","classification",")","transform","a","count","matrix","to","a","normalized","Tfrf","representation","Tf","means","term-frequency","while","RF","means","relevance","frequency",".","Parameters","--","--","--","--","--","norm",":","'l1","'",",","'l2","'",",","'max","'","or","None",",","optional","Norm","used","to","normalize","term","vectors",".","None","for","no","normalization",".","smooth_df",":","boolean","or","int",",","default=True","Smooth","df","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",":","boolean",",","default=False","Apply","sublinear","tf","scaling",",","i.e",".","replace","tf","with","1","+","log","(","tf",")",".","References","--","--","--","--","--","..","[","M.","Lan",",","C.","L.","Tan",",","J.","Su",",","and","Y.","Lu","]","`","Supervised","and","traditional","term","weighting","methods","for","automatic","text","categorization","`"]
code: def transform(self, X):
      if self.sublinear_tf:
          X = ensure_sparse_format(X)
          np.log(X.data, X.data)
          X.data += 1
  
      tp = self._tp
      fn = self._fn
  
      f = self._n_features
  
      k = np.log2(2 + tp / fn)
  
      X = X * sp.spdiags(k, 0, f, f)
      if self.norm:
          X = normalize(X, self.norm, copy=False)
  
      return X
  
imports: import collections
  import itertools
  import numpy
  import scipy.sparse
  from scipy.stats import norm
  from sklearn.decomposition import TruncatedSVD
  from sklearn.preprocessing import normalize
  from sklearn.base import TransformerMixin, BaseEstimator
  from gensim.models.keyedvectors import BaseKeyedVectors
label_desc: Use image node_id 1 for calling the TfrfVectorizer obj's underlying member method code with example usage: obj.transform(X) and returns: X