class_docstr: An implementation of `"NodeSketch" <https://exascale.info/assets/pdf/yang2019nodesketch.pdf>`_
  from the KDD '19 paper "NodeSketch: Highly-Efficient Graph Embeddings
  via Recursive Sketching". The procedure  starts by sketching the self-loop-augmented
  adjacency matrix of the graph to output low-order node embeddings, and then recursively
  generates k-order node embeddings based on the self-loop-augmented adjacency matrix
  and (k-1)-order node embeddings.
  
  Args:
      dimensions (int): Embedding dimensions. Default is 32.
      iterations (int): Number of iterations (sketch order minus one). Default is 2.
      decay (float): Exponential decay rate. Default is 0.01.
      seed (int): Random seed value. Default is 42.
class_docstr_tok: ["An","implementation","of","`","``","NodeSketch","''","<","https",":","\/\/exascale.info\/assets\/pdf\/yang2019nodesketch.pdf",">","`","_","from","the","KDD","'19","paper","``","NodeSketch",":","Highly-Efficient","Graph","Embeddings","via","Recursive","Sketching","''",".","The","procedure","starts","by","sketching","the","self-loop-augmented","adjacency","matrix","of","the","graph","to","output","low-order","node","embeddings",",","and","then","recursively","generates","k-order","node","embeddings","based","on","the","self-loop-augmented","adjacency","matrix","and","(","k-1",")","-order","node","embeddings",".","Args",":","dimensions","(","int",")",":","Embedding","dimensions",".","Default","is","32.","iterations","(","int",")",":","Number","of","iterations","(","sketch","order","minus","one",")",".","Default","is","2.","decay","(","float",")",":","Exponential","decay","rate",".","Default","is","0.01.","seed","(","int",")",":","Random","seed","value",".","Default","is","42","."]
docstr: Perform a single round of sketching
docstr_tok: ["Perform","a","single","round","of","sketching"]
code: def _do_single_sketch(self):
      """
      Perform a single round of sketching
      """
      sketch = []
      for iter in range(self.dimensions):
          hashed = self._sla.copy()
          hashed.data = np.array(
              [
                  self._hash_values[iter, self._sla.col[edge]]
                  / self._sla.data[edge]
                  for edge in range(len(self._sla.data))
              ]
          )
          min_values = [np.inf for k in range(self._num_nodes)]
          min_indices = [None for k in range(self._num_nodes)]
          for i, j, v in zip(hashed.row, hashed.col, hashed.data):
              if v < min_values[i]:
                  min_values[i] = v
                  min_indices[i] = j
          sketch.append(min_indices)
      self._sketch = sketch
  
file_path: karateclub/karateclub/node_embedding/neighbourhood/nodesketch.py
imports: import networkx
  import numpy
  from collections import Counter
  from karateclub.estimator import Estimator
label_desc: Use image node_id 3 for calling the NodeSketch obj's underlying member method code with example usage: obj._do_single_sketch() without return types