class_docstr: BlogCatalog dataset implementation.
  
  Args:
  
      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.
  
      num_groups (int): Number of classes.
  
      train_index (numpy.ndarray): The index for nodes in training set.
  
      test_index (numpy.ndarray): The index for nodes in validation set.
class_docstr_tok: ["BlogCatalog","dataset","implementation",".","Args",":","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",".","num_groups","(","int",")",":","Number","of","classes",".","train_index","(","numpy.ndarray",")",":","The","index","for","nodes","in","training","set",".","test_index","(","numpy.ndarray",")",":","The","index","for","nodes","in","validation","set","."]
code: def _load_data(self):
      edge_path = os.path.join(self.path, "edges.csv")
      node_path = os.path.join(self.path, "nodes.csv")
      group_edge_path = os.path.join(self.path, "group-edges.csv")
  
      all_edges = []
  
      with io.open(node_path) as inf:
          num_nodes = len(inf.readlines())
  
      node_feature = np.zeros((num_nodes, self.num_groups))
  
      with io.open(group_edge_path) as inf:
          for line in inf:
              node_id, group_id = line.strip("\n").split(",")
              node_id, group_id = int(node_id) - 1, int(group_id) - 1
              node_feature[node_id][group_id] = 1
  
      with io.open(edge_path) as inf:
          for line in inf:
              u, v = line.strip("\n").split(",")
              u, v = int(u) - 1, int(v) - 1
              all_edges.append((u, v))
              if self.symmetry_edges:
                  all_edges.append((v, u))
  
      if self.self_loop:
          for i in range(num_nodes):
              all_edges.append((i, i))
  
      all_edges = list(set(all_edges))
      self.graph = Graph(
          num_nodes=num_nodes,
          edges=all_edges,
          node_feat={"group_id": node_feature},
      )
  
      perm = np.arange(0, num_nodes)
      np.random.shuffle(perm)
      train_num = int(num_nodes * 0.5)
      self.train_index = perm[:train_num]
      self.test_index = perm[train_num:]
  
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 BlogCatalogDataset obj's underlying member method code with example usage: obj._load_data() without return types