class_docstr: An implementation of `"NetLSD" <https://arxiv.org/abs/1805.10712>`_
  from the KDD '18 paper "NetLSD: Hearing the Shape of a Graph". The procedure
  calculate the heat kernel trace of the normalized Laplacian matrix over a
  vector of time scales. If the matrix is large it switches to an approximation
  of the eigenvalues.
  
  Args:
      scale_min (float): Time scale interval minimum. Default is -2.0.
      scale_max (float): Time scale interval maximum. Default is 2.0.
      scale_steps (int): Number of steps in time scale. Default is 250.
      scale_approximations (int): Number of eigenvalue approximations. Default is 200.
      seed (int): Random seed value. Default is 42.
class_docstr_tok: ["An","implementation","of","`","``","NetLSD","''","<","https",":","\/\/arxiv.org\/abs\/1805.10712",">","`","_","from","the","KDD","'18","paper","``","NetLSD",":","Hearing","the","Shape","of","a","Graph","''",".","The","procedure","calculate","the","heat","kernel","trace","of","the","normalized","Laplacian","matrix","over","a","vector","of","time","scales",".","If","the","matrix","is","large","it","switches","to","an","approximation","of","the","eigenvalues",".","Args",":","scale_min","(","float",")",":","Time","scale","interval","minimum",".","Default","is","-2.0.","scale_max","(","float",")",":","Time","scale","interval","maximum",".","Default","is","2.0.","scale_steps","(","int",")",":","Number","of","steps","in","time","scale",".","Default","is","250.","scale_approximations","(","int",")",":","Number","of","eigenvalue","approximations",".","Default","is","200.","seed","(","int",")",":","Random","seed","value",".","Default","is","42","."]
docstr: Calculating the heat kernel trace of the normalized Laplacian.
  
  Arg types:
      * **eigenvalues** *(Numpy array)* - The eigenvalues of the graph.
  
  Return types:
      * **heat_kernel_trace** *(Numpy array)* - The heat kernel trace of the graph.
docstr_tok: ["Calculating","the","heat","kernel","trace","of","the","normalized","Laplacian",".","Arg","types",":","*","*","*","eigenvalues","*","*","*","(","Numpy","array",")","*","-","The","eigenvalues","of","the","graph",".","Return","types",":","*","*","*","heat_kernel_trace","*","*","*","(","Numpy","array",")","*","-","The","heat","kernel","trace","of","the","graph","."]
code: def _calculate_heat_kernel_trace(self, eigenvalues):
      """
      Calculating the heat kernel trace of the normalized Laplacian.
  
      Arg types:
          * **eigenvalues** *(Numpy array)* - The eigenvalues of the graph.
  
      Return types:
          * **heat_kernel_trace** *(Numpy array)* - The heat kernel trace of the graph.
      """
      timescales = np.logspace(
          self.scale_min, self.scale_max, self.scale_steps
      )
      nodes = eigenvalues.shape[0]
      heat_kernel_trace = np.zeros(timescales.shape)
      for idx, t in enumerate(timescales):
          heat_kernel_trace[idx] = np.sum(np.exp(-t * eigenvalues))
      heat_kernel_trace = heat_kernel_trace / nodes
      return heat_kernel_trace
  
file_path: karateclub/karateclub/graph_embedding/netlsd.py
imports: import numpy
  import networkx
  from typing import List
  import scipy.sparse
  from karateclub.estimator import Estimator
label_desc: Use image node_id 2 for calling the NetLSD obj's underlying member method code with example usage: obj._calculate_heat_kernel_trace(eigenvalues) and returns: heat_kernel_trace