code: def df2idf(docfreq, totaldocs, log_base=2.0, add=0.0):
      r"""Compute inverse-document-frequency for a term with the given document frequency `docfreq`:
      :math:`idf = add + log_{log\_base} \frac{totaldocs}{docfreq}`
  
      Parameters
      ----------
      docfreq : {int, float}
          Document frequency.
      totaldocs : int
          Total number of documents.
      log_base : float, optional
          Base of logarithm.
      add : float, optional
          Offset.
  
      Returns
      -------
      float
          Inverse document frequency.
  
      """
      return add + np.log(float(totaldocs) / docfreq) / np.log(log_base)
  
file_path: gensim/gensim/models/tfidfmodel.py
imports: import logging
  from functools import partial
  import re
  import numpy
  from gensim import interfaces, matutils, utils
  from gensim.utils import deprecated
label_desc: Use image node_id 2 for calling a global function with example usage: df2idf(docfreq, totaldocs, log_base, add) and returns: unknown