class_docstr: An implementation of `"SINE" <https://arxiv.org/pdf/1810.06768.pdf>`_
  from the ICDM '18 paper "SINE: Scalable Incomplete Network Embedding". The
  procedure implicitly factorizes a joint adjacency matrix power and feature matrix.
  The decomposition happens on truncated random walks and the adjacency matrix powers
  are pooled together.
  
  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 5.
      epochs (int): Number of epochs. Default is 1.
      use_hierarchical_softmax (bool): Whether to use hierarchical softmax or negative sampling to train the model.
      number_of_negative_samples (int): Number of negative nodes to sample (usually between 5-20). If set to 0, no negative sampling is used. Default is 5.
      learning_rate (float): HogWild! learning rate. Default is 0.05.
      min_count (int): Minimal count of node occurrences. Default is 1.
      seed (int): Random seed value. Default is 42.
class_docstr_tok: ["An","implementation","of","`","``","SINE","''","<","https",":","\/\/arxiv.org\/pdf\/1810.06768.pdf",">","`","_","from","the","ICDM","'18","paper","``","SINE",":","Scalable","Incomplete","Network","Embedding","''",".","The","procedure","implicitly","factorizes","a","joint","adjacency","matrix","power","and","feature","matrix",".","The","decomposition","happens","on","truncated","random","walks","and","the","adjacency","matrix","powers","are","pooled","together",".","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","5.","epochs","(","int",")",":","Number","of","epochs",".","Default","is","1.","use_hierarchical_softmax","(","bool",")",":","Whether","to","use","hierarchical","softmax","or","negative","sampling","to","train","the","model",".","number_of_negative_samples","(","int",")",":","Number","of","negative","nodes","to","sample","(","usually","between","5-20",")",".","If","set","to","0",",","no","negative","sampling","is","used",".","Default","is","5.","learning_rate","(","float",")",":","HogWild","!","learning","rate",".","Default","is","0.05.","min_count","(","int",")",":","Minimal","count","of","node","occurrences",".","Default","is","1.","seed","(","int",")",":","Random","seed","value",".","Default","is","42","."]
docstr: Fitting a SINE model.
  
  Arg types:
      * **graph** *(NetworkX graph)* - The graph to be embedded.
      * **X** *(Scipy COO array)* - The matrix of node features.
docstr_tok: ["Fitting","a","SINE","model",".","Arg","types",":","*","*","*","graph","*","*","*","(","NetworkX","graph",")","*","-","The","graph","to","be","embedded",".","*","*","*","X","*","*","*","(","Scipy","COO","array",")","*","-","The","matrix","of","node","features","."]
code: def fit(
      self,
      graph: nx.classes.graph.Graph,
      X: Union[np.array, coo_matrix],
  ):
      """
      Fitting a SINE model.
  
      Arg types:
          * **graph** *(NetworkX graph)* - The graph to be embedded.
          * **X** *(Scipy COO array)* - The matrix of node features.
      """
      self._set_seed()
      graph = self._check_graph(graph)
      self._walker = RandomWalker(self.walk_length, self.walk_number)
      self._walker.do_walks(graph)
      self._features = self._feature_transform(graph, X)
      self._select_walklets()
  
      model = Word2Vec(
          self._walklets,
          hs=0,
          negative=self.number_of_negative_samples,
          alpha=self.learning_rate,
          vector_size=self.dimensions,
          window=1,
          min_count=self.min_count,
          workers=self.workers,
          seed=self.seed,
          epochs=self.epochs,
      )
  
      self.embedding = np.array(
          [model.wv[str(n)] for n in range(graph.number_of_nodes())]
      )
  
file_path: karateclub/karateclub/node_embedding/attributed/sine.py
imports: import random
  import numpy
  import networkx
  from typing import Union
  from scipy.sparse import coo_matrix
  from karateclub.estimator import Estimator
  from gensim.models.word2vec import Word2Vec
  from karateclub.utils.walker import RandomWalker
label_desc: Use image node_id 4 for calling the SINE obj's underlying member method code with example usage: obj.fit(graph, X) without return types