class_docstr: A synthetic graph dataset generated by the stochastic block model.
  The node features of each block are sampled from normal distributions where
  the centers of clusters are vertices of a hypercube, as computed by the
  :meth:`sklearn.datasets.make_classification` method.
  
  Args:
      root (str): Root directory where the dataset should be saved.
      block_sizes ([int] or LongTensor): The sizes of blocks.
      edge_probs ([[float]] or FloatTensor): The density of edges going from
          each block to each other block. Must be symmetric if the graph is
          undirected.
      num_graphs (int, optional): The number of graphs. (default: :obj:`1`)
      num_channels (int, optional): The number of node features. If given
          as :obj:`None`, node features are not generated.
          (default: :obj:`None`)
      is_undirected (bool, optional): Whether the graph to generate is
          undirected. (default: :obj:`True`)
      transform (callable, optional): A function/transform that takes in
          an :obj:`torch_geometric.data.Data` object and returns a
          transformed version. The data object will be transformed before
          every access. (default: :obj:`None`)
      pre_transform (callable, optional): A function/transform that takes
          in an :obj:`torch_geometric.data.Data` object and returns a
          transformed version. The data object will be transformed
          before being saved to disk. (default: :obj:`None`)
      force_reload (bool, optional): Whether to re-process the dataset.
          (default: :obj:`False`)
      **kwargs (optional): The keyword arguments that are passed down to the
          :meth:`sklearn.datasets.make_classification` method for drawing
          node features.
class_docstr_tok: ["A","synthetic","graph","dataset","generated","by","the","stochastic","block","model",".","The","node","features","of","each","block","are","sampled","from","normal","distributions","where","the","centers","of","clusters","are","vertices","of","a","hypercube",",","as","computed","by","the",":","meth",":","`","sklearn.datasets.make_classification","`","method",".","Args",":","root","(","str",")",":","Root","directory","where","the","dataset","should","be","saved",".","block_sizes","(","[","int","]","or","LongTensor",")",":","The","sizes","of","blocks",".","edge_probs","(","[","[","float","]","]","or","FloatTensor",")",":","The","density","of","edges","going","from","each","block","to","each","other","block",".","Must","be","symmetric","if","the","graph","is","undirected",".","num_graphs","(","int",",","optional",")",":","The","number","of","graphs",".","(","default",":",":","obj",":","`","1","`",")","num_channels","(","int",",","optional",")",":","The","number","of","node","features",".","If","given","as",":","obj",":","`","None","`",",","node","features","are","not","generated",".","(","default",":",":","obj",":","`","None","`",")","is_undirected","(","bool",",","optional",")",":","Whether","the","graph","to","generate","is","undirected",".","(","default",":",":","obj",":","`","True","`",")","transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","an",":","obj",":","`","torch_geometric.data.Data","`","object","and","returns","a","transformed","version",".","The","data","object","will","be","transformed","before","every","access",".","(","default",":",":","obj",":","`","None","`",")","pre_transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","an",":","obj",":","`","torch_geometric.data.Data","`","object","and","returns","a","transformed","version",".","The","data","object","will","be","transformed","before","being","saved","to","disk",".","(","default",":",":","obj",":","`","None","`",")","force_reload","(","bool",",","optional",")",":","Whether","to","re-process","the","dataset",".","(","default",":",":","obj",":","`","False","`",")","*","*","kwargs","(","optional",")",":","The","keyword","arguments","that","are","passed","down","to","the",":","meth",":","`","sklearn.datasets.make_classification","`","method","for","drawing","node","features","."]
code: def process(self) -> None:
      from sklearn.datasets import make_classification
  
      edge_index = stochastic_blockmodel_graph(
          self.block_sizes,
          self.edge_probs,
          directed=not self.is_undirected,
      )
  
      num_samples = int(self.block_sizes.sum())
      num_classes = self.block_sizes.size(0)
  
      data_list = []
      for _ in range(self.num_graphs):
          x = None
          if self.num_channels is not None:
              x, y_not_sorted = make_classification(
                  n_samples=num_samples,
                  n_features=self.num_channels,
                  n_classes=num_classes,
                  weights=self.block_sizes / num_samples,
                  **self.kwargs,
              )
              x = x[np.argsort(y_not_sorted)]
              x = torch.from_numpy(x).to(torch.float)
  
          y = torch.arange(num_classes).repeat_interleave(
              self.block_sizes
          )
  
          data = Data(x=x, edge_index=edge_index, y=y)
  
          if self.pre_transform is not None:
              data = self.pre_transform(data)
  
          data_list.append(data)
  
      self.save(data_list, self.processed_paths[0])
  
file_path: pytorch_geometric/torch_geometric/datasets/sbm_dataset.py
imports: import os.path
  from typing import Any, Callable, List, Optional, Union
  import numpy
  import torch
  from torch import Tensor
  from torch_geometric.data import Data, InMemoryDataset
  from torch_geometric.utils import stochastic_blockmodel_graph
label_desc: Use image node_id 4 for calling the StochasticBlockModelDataset obj's underlying member method code with example usage: obj.process() without return types