class_docstr: A data generator for node prediction with Homogeneous GraphSAGE models
  
  At minimum, supply the Neo4jStellarGraph, the batch size, and the number of
  node samples for each layer of the GraphSAGE model.
  
  The supplied graph should be a Neo4jStellarGraph object with node features.
  
  Use the :meth:`flow` method supplying the nodes and (optionally) targets
  to get an object that can be used as a Keras data generator.
  
  Example::
  
      G_generator = GraphSAGENodeGenerator(G, 50, [10,10])
      train_data_gen = G_generator.flow(train_node_ids, train_node_labels)
      test_data_gen = G_generator.flow(test_node_ids)
  
  .. seealso::
  
     Model using this generator: :class:`.GraphSAGE`.
  
     Example using this generator: `node classification <https://stellargraph.readthedocs.io/en/stable/demos/connector/neo4j/undirected-graphsage-on-cora-neo4j-example.html>`__.
  
     Related functionality: :class:`.GraphSAGENodeGenerator` for using :class:`.GraphSAGE` without Neo4j.
  
  Args:
      graph (Neo4jStellarGraph): Neo4jStellarGraph object
      batch_size (int): Size of batch to return.
      num_samples (list): The number of samples per layer (hop) to take.
      name (int, optional): Optional name for the generator.
class_docstr_tok: ["A","data","generator","for","node","prediction","with","Homogeneous","GraphSAGE","models","At","minimum",",","supply","the","Neo4jStellarGraph",",","the","batch","size",",","and","the","number","of","node","samples","for","each","layer","of","the","GraphSAGE","model",".","The","supplied","graph","should","be","a","Neo4jStellarGraph","object","with","node","features",".","Use","the",":","meth",":","`","flow","`","method","supplying","the","nodes","and","(","optionally",")","targets","to","get","an","object","that","can","be","used","as","a","Keras","data","generator",".","Example",":",":","G_generator","=","GraphSAGENodeGenerator","(","G",",","50",",","[","10,10","]",")","train_data_gen","=","G_generator.flow","(","train_node_ids",",","train_node_labels",")","test_data_gen","=","G_generator.flow","(","test_node_ids",")","..","seealso",":",":","Model","using","this","generator",":",":","class",":","`",".GraphSAGE","`",".","Example","using","this","generator",":","`","node","classification","<","https",":","\/\/stellargraph.readthedocs.io\/en\/stable\/demos\/connector\/neo4j\/undirected-graphsage-on-cora-neo4j-example.html",">","`","__",".","Related","functionality",":",":","class",":","`",".GraphSAGENodeGenerator","`","for","using",":","class",":","`",".GraphSAGE","`","without","Neo4j",".","Args",":","graph","(","Neo4jStellarGraph",")",":","Neo4jStellarGraph","object","batch_size","(","int",")",":","Size","of","batch","to","return",".","num_samples","(","list",")",":","The","number","of","samples","per","layer","(","hop",")","to","take",".","name","(","int",",","optional",")",":","Optional","name","for","the","generator","."]
code: def __init__(self, graph, batch_size, num_samples, name=None):
      super().__init__(graph, batch_size)
  
      self.num_samples = num_samples
      self.name = name
  
      # check that there is only a single node type for GraphSAGE
  
      self.sampler = Neo4jSampledBreadthFirstWalk(graph)
  
file_path: stellargraph/stellargraph/connector/neo4j/mapper.py
imports: import numpy
  import random
  from .sampler import Neo4jDirectedBreadthFirstNeighbors, Neo4jSampledBreadthFirstWalk
  from ...core.graph import GraphSchema
  from ...mapper import NodeSequence
  from ...mapper.sampled_node_generators import BatchedNodeGenerator
  from ...core.experimental import experimental
  from .graph import Neo4jStellarGraph
label_desc: Use image node_id 1 to create a new Neo4jGraphSAGENodeGenerator object from inherited base classes: Neo4jBatchedNodeGenerator with example: obj = Neo4jGraphSAGENodeGenerator(graph, batch_size, num_samples, name)