class_docstr: AmazonCoBuy dataset for node classification task.
  
  Amazon Computers and Amazon Photo are segments of the Amazon co-purchase graph [McAuley et al., 2015],
  where nodes represent goods, edges indicate that two goods are frequently bought together, node
  features are bag-of-words encoded product reviews, and class labels are given by the product category.
  
  Reference: `<https://github.com/shchur/gnn-benchmark#datasets>`_
  
  Statistics
  
  - Nodes: 7,650
  - Edges: 238,163 (note that the original dataset has 119,043 edges but DGL adds
    the reverse edges and remove the duplicates, hence with a different number)
  - Number of classes: 8
  - Node feature size: 745
  
  Parameters
  ----------
  raw_dir : str
      Raw file directory to download/contains the input data directory.
      Default: ~/.dgl/
  force_reload : bool
      Whether to reload the dataset. Default: False
  verbose : bool
      Whether to print out progress information. Default: True.
  transform : callable, optional
      A transform that takes in a :class:`~dgl.DGLGraph` object and returns
      a transformed version. The :class:`~dgl.DGLGraph` object will be
      transformed before every access.
  
  Attributes
  ----------
  num_classes : int
      Number of classes for each node.
  
  Examples
  --------
  >>> data = AmazonCoBuyPhotoDataset()
  >>> g = data[0]
  >>> num_class = data.num_classes
  >>> feat = g.ndata['feat']  # get node feature
  >>> label = g.ndata['label']  # get node labels
class_docstr_tok: ["AmazonCoBuy","dataset","for","node","classification","task",".","Amazon","Computers","and","Amazon","Photo","are","segments","of","the","Amazon","co-purchase","graph","[","McAuley","et","al.",",","2015","]",",","where","nodes","represent","goods",",","edges","indicate","that","two","goods","are","frequently","bought","together",",","node","features","are","bag-of-words","encoded","product","reviews",",","and","class","labels","are","given","by","the","product","category",".","Reference",":","`","<","https",":","\/\/github.com\/shchur\/gnn-benchmark","#","datasets",">","`","_","Statistics","-","Nodes",":","7,650","-","Edges",":","238,163","(","note","that","the","original","dataset","has","119,043","edges","but","DGL","adds","the","reverse","edges","and","remove","the","duplicates",",","hence","with","a","different","number",")","-","Number","of","classes",":","8","-","Node","feature","size",":","745","Parameters","--","--","--","--","--","raw_dir",":","str","Raw","file","directory","to","download\/contains","the","input","data","directory",".","Default",":","~\/.dgl\/","force_reload",":","bool","Whether","to","reload","the","dataset",".","Default",":","False","verbose",":","bool","Whether","to","print","out","progress","information",".","Default",":","True",".","transform",":","callable",",","optional","A","transform","that","takes","in","a",":","class",":","`","~dgl.DGLGraph","`","object","and","returns","a","transformed","version",".","The",":","class",":","`","~dgl.DGLGraph","`","object","will","be","transformed","before","every","access",".","Attributes","--","--","--","--","--","num_classes",":","int","Number","of","classes","for","each","node",".","Examples","--","--","--","--",">",">",">","data","=","AmazonCoBuyPhotoDataset","(",")",">",">",">","g","=","data","[","0","]",">",">",">","num_class","=","data.num_classes",">",">",">","feat","=","g.ndata","[","'feat","'","]","#","get","node","feature",">",">",">","label","=","g.ndata","[","'label","'","]","#","get","node","labels"]
code: def __init__(
      self,
      raw_dir=None,
      force_reload=False,
      verbose=False,
      transform=None,
  ):
      super(AmazonCoBuyPhotoDataset, self).__init__(
          name="amazon_co_buy_photo",
          raw_dir=raw_dir,
          force_reload=force_reload,
          verbose=verbose,
          transform=transform,
      )
  
imports: import os
  import numpy
  import scipy.sparse
  from ..None import backend, transforms
  from ..convert import graph
  from .dgl_dataset import DGLBuiltinDataset
  from .utils import _get_dgl_url, deprecate_class, deprecate_property, load_graphs, save_graphs
label_desc: Use image node_id 1 to create a new AmazonCoBuyPhotoDataset object from inherited base classes: GNNBenchmarkDataset with example: obj = AmazonCoBuyPhotoDataset(raw_dir, force_reload, verbose, transform)