class_docstr: An implementation of `"LDP" <https://arxiv.org/abs/1811.03508>`_ from the
  ICLR Representation Learning on Graphs and Manifolds Workshop '19 paper "A
  Simple Yet Effective Baseline for Non-Attributed Graph Classification". The
  procedure calculates histograms of degree profiles. These concatenated
  histograms form the graph representations.
  
  Args:
      bins (int): Number of histogram bins. Default is 32.
docstr: Calculating the local degree profile 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","local","degree","profile","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_ldp(self, graph):
      """
      Calculating the local degree profile 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.
      """
      degrees = np.log(
          np.array(
              [graph.degree[n] for n in range(graph.number_of_nodes())]
          )
      )
      features = []
      for n in range(graph.number_of_nodes()):
          nebs = [neb for neb in graph.neighbors(n)]
          degs = degrees[nebs]
  
          features.append(
              [np.min(degs), np.max(degs), np.std(degs), np.mean(degs)]
          )
  
      features = np.concatenate(
          [degrees.reshape(-1, 1), np.array(features)], axis=1
      )
      embedding = []
      for i in range(features.shape[1]):
          x = features[:, i]
          emb = np.histogram(x, bins=self.bins, range=(0.0, 10.0))[0]
          embedding.append(emb)
      embedding = np.concatenate(embedding).reshape(-1)
      return embedding
  
file_path: karateclub/karateclub/graph_embedding/ldp.py
imports: import numpy
  import networkx
  from karateclub.estimator import Estimator
  from typing import List
label_desc: Use image node_id 2 for calling the LDP obj's underlying member method code with example usage: obj._calculate_ldp(graph) and returns: embedding