class_docstr: An implementation of `"Invariant Graph Embedding" <https://graphreason.github.io/papers/16.pdf>`_
  from the ICML 2019 Workshop on Learning and Reasoning with Graph-Structured
  Data paper "Invariant Embedding for Graph Classification". The procedure
  computes a mixture of spectral and node embedding based features. Specifically,
  it uses scattering, eigenvalues and pooled node feature embeddings to create
  graph descriptors.
  
  Args:
      feature_embedding_dimensions (list): Feature embedding dimensions. Default is [3, 5]
      spectral_embedding_dimensions (list): Spectral embedding dimensions. Default is [10, 20].
      histogram_bins (list): Number of histogram bins. Default is [10, 20].
      seed (int): Random seed value. Default is 42.
class_docstr_tok: ["An","implementation","of","`","``","Invariant","Graph","Embedding","''","<","https",":","\/\/graphreason.github.io\/papers\/16.pdf",">","`","_","from","the","ICML","2019","Workshop","on","Learning","and","Reasoning","with","Graph-Structured","Data","paper","``","Invariant","Embedding","for","Graph","Classification","''",".","The","procedure","computes","a","mixture","of","spectral","and","node","embedding","based","features",".","Specifically",",","it","uses","scattering",",","eigenvalues","and","pooled","node","feature","embeddings","to","create","graph","descriptors",".","Args",":","feature_embedding_dimensions","(","list",")",":","Feature","embedding","dimensions",".","Default","is","[","3",",","5","]","spectral_embedding_dimensions","(","list",")",":","Spectral","embedding","dimensions",".","Default","is","[","10",",","20","]",".","histogram_bins","(","list",")",":","Number","of","histogram","bins",".","Default","is","[","10",",","20","]",".","seed","(","int",")",":","Random","seed","value",".","Default","is","42","."]
docstr: Calculating the embedding features.
  
  Arg types:
      * **graph** *(NetworkX graph)* - The graph of interest.
      * **features** *(list)* - The list of graph feature NumPy arrays.
  
  Return types:
      * **features** *(list)* - The list of graph feature NumPy arrays.
docstr_tok: ["Calculating","the","embedding","features",".","Arg","types",":","*","*","*","graph","*","*","*","(","NetworkX","graph",")","*","-","The","graph","of","interest",".","*","*","*","features","*","*","*","(","list",")","*","-","The","list","of","graph","feature","NumPy","arrays",".","Return","types",":","*","*","*","features","*","*","*","(","list",")","*","-","The","list","of","graph","feature","NumPy","arrays","."]
code: def _get_embedding_features(self, graph, features):
      """
      Calculating the embedding features.
  
      Arg types:
          * **graph** *(NetworkX graph)* - The graph of interest.
          * **features** *(list)* - The list of graph feature NumPy arrays.
  
      Return types:
          * **features** *(list)* - The list of graph feature NumPy arrays.
      """
      number_of_nodes = graph.number_of_nodes()
      mat_eye = np.eye(self.max_deg + 1)
      degrees = [graph.degree[node] for node in graph.nodes()]
      sub_features = mat_eye[degrees]
      feature_dim = sub_features.shape[1]
      for emb_dim in self.feature_embedding_dimensions:
          emb_space_full = emb_dim * feature_dim
  
          embed_space = np.zeros((emb_space_full, number_of_nodes))
          P = self._get_normalized_adjacency(graph)
          Q = self._get_normalized_adjacency(graph)
          for i in range(emb_dim):
              P = P.dot(Q)
              embed_space[
                  i * feature_dim : (i + 1) * feature_dim, :
              ] = P.dot(sub_features).T
  
          features.append(np.mean(embed_space, axis=1).T)
      return features
  
file_path: karateclub/karateclub/graph_embedding/ige.py
imports: from typing import List
  import numpy
  import networkx
  import scipy.sparse
  from karateclub.estimator import Estimator
label_desc: Use image node_id 4 for calling the IGE obj's underlying member method code with example usage: obj._get_embedding_features(graph, features) and returns: features