class_docstr: Reddit dataset implementation.
  
  Args:
  
      normalize (bool): Whether to normalize feature.
  
      symmetry (bool): Whether to create symmetry edges.
  
  Attributes:
  
      graph (pgl.Graph): The :code:`Graph` data object.
  
      feature (numpy.ndarray): The feature of 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.
  
      train_label (numpy.ndarray): The label for nodes in training set.
  
      val_label (numpy.ndarray): The label for nodes in validation set.
  
      test_label (numpy.ndarray): The label for nodes in test set.
class_docstr_tok: ["Reddit","dataset","implementation",".","Args",":","normalize","(","bool",")",":","Whether","to","normalize","feature",".","symmetry","(","bool",")",":","Whether","to","create","symmetry","edges",".","Attributes",":","graph","(","pgl.Graph",")",":","The",":","code",":","`","Graph","`","data","object",".","feature","(","numpy.ndarray",")",":","The","feature","of","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",".","train_label","(","numpy.ndarray",")",":","The","label","for","nodes","in","training","set",".","val_label","(","numpy.ndarray",")",":","The","label","for","nodes","in","validation","set",".","test_label","(","numpy.ndarray",")",":","The","label","for","nodes","in","test","set","."]
code: def _load_data(self, normalize=True, symmetry=True):
      from sklearn.preprocessing import StandardScaler
      import scipy.sparse as sp
  
      data = np.load(os.path.join(self.path, "reddit.npz"))
      adj = sp.load_npz(os.path.join(self.path, "reddit_adj.npz"))
      if symmetry:
          adj = adj + adj.T
      adj = adj.tocoo()
      src = adj.row
      dst = adj.col
  
      num_classes = 41
      train_label = data["y_train"]
      val_label = data["y_val"]
      test_label = data["y_test"]
  
      train_index = data["train_index"]
      val_index = data["val_index"]
      test_index = data["test_index"]
  
      feature = data["feats"].astype("float32")
  
      if normalize:
          scaler = StandardScaler()
          scaler.fit(feature[train_index])
          feature = scaler.transform(feature)
  
      graph = Graph(
          num_nodes=feature.shape[0], edges=list(zip(src, dst))
      )
  
      self.graph = graph
      self.train_index = train_index
      self.train_label = train_label
      self.val_label = val_label
      self.val_index = val_index
      self.test_index = test_index
      self.test_label = test_label
      self.feature = feature
      self.num_classes = 41
  
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 RedditDataset obj's underlying member method code with example usage: obj._load_data(normalize, symmetry) without return types