class_docstr: An implementation of `"Role2vec" <https://arxiv.org/abs/1802.02896>`_
  from the IJCAI '18 paper "Learning Role-based Graph Embeddings".
  The procedure uses random walks to approximate the pointwise mutual information
  matrix obtained by multiplying the pooled adjacency power matrix with a
  structural feature matrix (in this case Weisfeiler-Lehman features). This way
  one gets structural node embeddings.
  
  Args:
      walk_number (int): Number of random walks. Default is 10.
      walk_length (int): Length of random walks. Default is 80.
      dimensions (int): Dimensionality of embedding. Default is 128.
      workers (int): Number of cores. Default is 4.
      window_size (int): Matrix power order. Default is 2.
      epochs (int): Number of epochs. Default is 1.
      learning_rate (float): HogWild! learning rate. Default is 0.05.
      down_sampling (float): Down sampling frequency. Default is 0.0001.
      min_count (int): Minimal count of feature occurrences. Default is 10.
      wl_iterations (int): Number of Weisfeiler-Lehman hashing iterations. Default is 2.
      seed (int): Random seed value. Default is 42.
      erase_base_features (bool): Removing the base features. Default is False.
docstr: Fitting a Role2vec model.
  
  Arg types:
      * **graph** *(NetworkX graph)* - The graph to be embedded.
docstr_tok: ["Fitting","a","Role2vec","model",".","Arg","types",":","*","*","*","graph","*","*","*","(","NetworkX","graph",")","*","-","The","graph","to","be","embedded","."]
code: def fit(self, graph: nx.classes.graph.Graph):
      """
      Fitting a Role2vec model.
  
      Arg types:
          * **graph** *(NetworkX graph)* - The graph to be embedded.
      """
      self._set_seed()
      graph = self._check_graph(graph)
      walker = RandomWalker(self.walk_length, self.walk_number)
      walker.do_walks(graph)
  
      hasher = WeisfeilerLehmanHashing(
          graph=graph,
          wl_iterations=self.wl_iterations,
          use_node_attribute=None,
          erase_base_features=self.erase_base_features,
      )
  
      node_features: Dict[int, List[str]] = hasher.get_node_features()
      documents: List[TaggedDocument] = self._create_documents(
          walker.walks, node_features
      )
  
      model = Doc2Vec(
          documents,
          vector_size=self.dimensions,
          window=0,
          min_count=self.min_count,
          dm=0,
          workers=self.workers,
          sample=self.down_sampling,
          epochs=self.epochs,
          alpha=self.learning_rate,
          seed=self.seed,
      )
  
      self._embedding = [
          model.dv[str(document_number)]
          for document_number in range(len(documents))
      ]
  
file_path: karateclub/karateclub/node_embedding/structural/role2vec.py
imports: from typing import Dict, List
  import numpy
  import networkx
  from gensim.models.doc2vec import Doc2Vec, TaggedDocument
  from karateclub.utils.walker import RandomWalker
  from karateclub.estimator import Estimator
  from karateclub.utils.treefeatures import WeisfeilerLehmanHashing
label_desc: Use image node_id 4 for calling the Role2Vec obj's underlying member method code with example usage: obj.fit(graph) without return types