class_docstr: Citation dataset helps to create data for citation dataset (Pubmed and Citeseer).
  
  Args:
  
      name (str): The name for the dataset ("pubmed" or "citeseer").
  
      symmetry_edges (bool): Whether to create symmetry edges.
  
      self_loop (bool):  Whether to contain self loop edges.
  
  Attributes:
  
      graph (pgl.Graph): The :code:`Graph` data object.
  
      y (numpy.ndarray): Labels for each nodes.
  
      num_classes (int): Number of classes.
  
      train_index (numpy.ndarray): The index for nodes in training set.
  
      val_index (numpy.ndarray): The index for nodes in validation set.
  
      test_index (numpy.ndarray): The index for nodes in test set.
class_docstr_tok: ["Citation","dataset","helps","to","create","data","for","citation","dataset","(","Pubmed","and","Citeseer",")",".","Args",":","name","(","str",")",":","The","name","for","the","dataset","(","``","pubmed","''","or","``","citeseer","''",")",".","symmetry_edges","(","bool",")",":","Whether","to","create","symmetry","edges",".","self_loop","(","bool",")",":","Whether","to","contain","self","loop","edges",".","Attributes",":","graph","(","pgl.Graph",")",":","The",":","code",":","`","Graph","`","data","object",".","y","(","numpy.ndarray",")",":","Labels","for","each","nodes",".","num_classes","(","int",")",":","Number","of","classes",".","train_index","(","numpy.ndarray",")",":","The","index","for","nodes","in","training","set",".","val_index","(","numpy.ndarray",")",":","The","index","for","nodes","in","validation","set",".","test_index","(","numpy.ndarray",")",":","The","index","for","nodes","in","test","set","."]
docstr: Load data
          
docstr_tok: ["Load","data"]
code: def _load_data(self):
      """Load data"""
      import networkx as nx
  
      objnames = ["x", "y", "tx", "ty", "allx", "ally", "graph"]
      objects = []
      for i in range(len(objnames)):
          with open(
              "{}/ind.{}.{}".format(self.path, self.name, objnames[i]),
              "rb",
          ) as f:
              objects.append(_pickle_load(f))
  
      x, y, tx, ty, allx, ally, _graph = objects
      test_idx_reorder = _parse_index_file(
          "{}/ind.{}.test.index".format(self.path, self.name)
      )
      test_idx_range = np.sort(test_idx_reorder)
  
      allx = allx.todense()
      tx = tx.todense()
      if self.name == "citeseer":
          # Fix citeseer dataset (there are some isolated nodes in the graph)
          # Find isolated nodes, add them as zero-vecs into the right position
          test_idx_range_full = range(
              min(test_idx_reorder), max(test_idx_reorder) + 1
          )
          tx_extended = np.zeros(
              (len(test_idx_range_full), x.shape[1]), dtype="float32"
          )
          tx_extended[test_idx_range - min(test_idx_range), :] = tx
          tx = tx_extended
          ty_extended = np.zeros(
              (len(test_idx_range_full), y.shape[1]), dtype="float32"
          )
          ty_extended[test_idx_range - min(test_idx_range), :] = ty
          ty = ty_extended
  
      features = np.vstack([allx, tx])
      features[test_idx_reorder, :] = features[test_idx_range, :]
      features = features / (np.sum(features, axis=-1) + 1e-15)
      features = np.array(features, dtype="float32")
      _graph = nx.DiGraph(nx.from_dict_of_lists(_graph))
  
      onehot_labels = np.vstack((ally, ty))
      onehot_labels[test_idx_reorder, :] = onehot_labels[
          test_idx_range, :
      ]
      labels = np.argmax(onehot_labels, 1)
  
      idx_test = test_idx_range.tolist()
      idx_train = range(len(y))
      idx_val = range(len(y), len(y) + 500)
      all_edges = []
      for i in _graph.edges():
          u, v = tuple(i)
          all_edges.append((u, v))
          if self.symmetry_edges:
              all_edges.append((v, u))
  
      if self.self_loop:
          for i in range(_graph.number_of_nodes()):
              all_edges.append((i, i))
      all_edges = list(set(all_edges))
  
      self.graph = Graph(
          num_nodes=_graph.number_of_nodes(),
          edges=all_edges,
          node_feat={"words": features},
      )
      self.y = np.array(labels, dtype="int64")
      self.num_classes = onehot_labels.shape[1]
      self.train_index = np.array(idx_train, dtype="int32")
      self.val_index = np.array(idx_val, dtype="int32")
      self.test_index = np.array(idx_test, dtype="int32")
  
imports: import os
  import io
  import sys
  import numpy
  import pickle
  from pgl.graph import Graph
label_desc: Use image node_id 2 for calling the CitationDataset obj's underlying member method code with example usage: obj._load_data() without return types