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 features of a graph.
  
  Arg types:
      * **graph** *(NetworkX graph)* - A graph to be embedded.
  
  Return types:
      * **hist** *(Numpy array)* - The embedding of a single graph.
docstr_tok: ["Calculating","the","features","of","a","graph",".","Arg","types",":","*","*","*","graph","*","*","*","(","NetworkX","graph",")","*","-","A","graph","to","be","embedded",".","Return","types",":","*","*","*","hist","*","*","*","(","Numpy","array",")","*","-","The","embedding","of","a","single","graph","."]
code: def _calculate_netlsd(self, graph):
      """
      Calculating the features of a graph.
  
      Arg types:
          * **graph** *(NetworkX graph)* - A graph to be embedded.
  
      Return types:
          * **hist** *(Numpy array)* - The embedding of a single graph.
      """
      graph.remove_edges_from(nx.selfloop_edges(graph))
      laplacian = sps.coo_matrix(
          nx.normalized_laplacian_matrix(
              graph, nodelist=range(graph.number_of_nodes())
          ),
          dtype=np.float32,
      )
      eigen_values = self._calculate_eigenvalues(laplacian)
      heat_kernel_trace = self._calculate_heat_kernel_trace(
          eigen_values
      )
      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 5 for calling the NetLSD obj's underlying member method code with example usage: obj._calculate_netlsd(graph) and returns: heat_kernel_trace