class_docstr: An implementation of `"SF" <https://arxiv.org/abs/1810.09155>`_
  from the NeurIPS Relational Representation Learning Workshop '18 paper "A Simple Baseline Algorithm for Graph Classification".
  The procedure calculates the k lowest eigenvalues of the normalized Laplacian.
  If the graph has a lower number of eigenvalues than k the representation is padded with zeros.
  
  Args:
      dimensions (int): Number of lowest eigenvalues. Default is 128.
      seed (int): Random seed value. Default is 42.
class_docstr_tok: ["An","implementation","of","`","``","SF","''","<","https",":","\/\/arxiv.org\/abs\/1810.09155",">","`","_","from","the","NeurIPS","Relational","Representation","Learning","Workshop","'18","paper","``","A","Simple","Baseline","Algorithm","for","Graph","Classification","''",".","The","procedure","calculates","the","k","lowest","eigenvalues","of","the","normalized","Laplacian",".","If","the","graph","has","a","lower","number","of","eigenvalues","than","k","the","representation","is","padded","with","zeros",".","Args",":","dimensions","(","int",")",":","Number","of","lowest","eigenvalues",".","Default","is","128.","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:
      * **embedding** *(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",":","*","*","*","embedding","*","*","*","(","Numpy","array",")","*","-","The","embedding","of","a","single","graph","."]
code: def _calculate_sf(self, graph):
      """
      Calculating the features of a graph.
  
      Arg types:
          * **graph** *(NetworkX graph)* - A graph to be embedded.
  
      Return types:
          * **embedding** *(Numpy array)* - The embedding of a single graph.
      """
      number_of_nodes = graph.number_of_nodes()
      L_tilde = nx.normalized_laplacian_matrix(
          graph, nodelist=range(number_of_nodes)
      )
      if number_of_nodes <= self.dimensions:
          embedding = eigsh(
              L_tilde,
              k=number_of_nodes - 1,
              which="LM",
              ncv=10 * self.dimensions,
              return_eigenvectors=False,
          )
  
          shape_diff = self.dimensions - embedding.shape[0] - 1
          embedding = np.pad(
              embedding, (1, shape_diff), "constant", constant_values=0
          )
      else:
          embedding = eigsh(
              L_tilde,
              k=self.dimensions,
              which="LM",
              ncv=10 * self.dimensions,
              return_eigenvectors=False,
          )
      return embedding
  
file_path: karateclub/karateclub/graph_embedding/sf.py
imports: import numpy
  import networkx
  from typing import List
  from scipy.sparse.linalg import eigsh
  from karateclub.estimator import Estimator
label_desc: Use image node_id 2 for calling the SF obj's underlying member method code with example usage: obj._calculate_sf(graph) and returns: embedding