class_docstr: The Ensemble class can be used to create ensembles of stellargraph's graph neural network algorithms including
  GCN, GraphSAGE, GAT, and HinSAGE. Ensembles can be used for training classification and regression problems for
  node attribute inference and link prediction.
  
  The Ensemble class can be used to create Naive ensembles.
  
  Naive ensembles add model diversity by random initialisation of the models' weights (before training) to
  different values. Each model in the ensemble is trained on the same training set of examples.
  
  .. seealso::
  
     Example using ensembles: `node classification <https://stellargraph.readthedocs.io/en/stable/demos/ensembles/ensemble-node-classification-example.html>`__.
  
     Related functionality: :class:`.BaggingEnsemble` for bootstrap sampling while training, in addition to random initialisation.
class_docstr_tok: ["The","Ensemble","class","can","be","used","to","create","ensembles","of","stellargraph","'s","graph","neural","network","algorithms","including","GCN",",","GraphSAGE",",","GAT",",","and","HinSAGE",".","Ensembles","can","be","used","for","training","classification","and","regression","problems","for","node","attribute","inference","and","link","prediction",".","The","Ensemble","class","can","be","used","to","create","Naive","ensembles",".","Naive","ensembles","add","model","diversity","by","random","initialisation","of","the","models","'","weights","(","before","training",")","to","different","values",".","Each","model","in","the","ensemble","is","trained","on","the","same","training","set","of","examples",".","..","seealso",":",":","Example","using","ensembles",":","`","node","classification","<","https",":","\/\/stellargraph.readthedocs.io\/en\/stable\/demos\/ensembles\/ensemble-node-classification-example.html",">","`","__",".","Related","functionality",":",":","class",":","`",".BaggingEnsemble","`","for","bootstrap","sampling","while","training",",","in","addition","to","random","initialisation","."]
docstr: Evaluates the ensemble on a data (node or link) generator. It makes `n_predictions` for each data point for each
  of the `n_estimators` and returns the mean and standard deviation of the predictions.
  
  For detailed descriptions of Keras-specific parameters consult the Keras documentation
  at https://keras.io/models/sequential/
  
  Args:
      generator: The generator object that, if test_data is not None, should be one of type
          GraphSAGENodeGenerator, HinSAGENodeGenerator, FullBatchNodeGenerator, GraphSAGELinkGenerator,
          or HinSAGELinkGenerator. However, if test_data is None, then generator should be one of type
          NodeSequence, LinkSequence, or FullBatchSequence.
      test_data (None or iterable): If not None, then it is an iterable, e.g. list, that specifies the node IDs
          to evaluate the model on.
      test_targets (None or iterable): If not None, then it is an iterable, e.g. list, that specifies the target
          values for the test_data.
      max_queue_size (int): (Keras-specific parameter) The maximum size for the generator queue.
      workers (int): (Keras-specific parameter) The maximum number of workers to use.
      use_multiprocessing (bool): (Keras-specific parameter) If True then use process based threading.
      verbose (int): (Keras-specific parameter) The verbosity mode that should be 0 or 1 with the former turning
          verbosity off and the latter on.
  
  Returns:
      tuple: The mean and standard deviation of the model metrics for the given data.
docstr_tok: ["Evaluates","the","ensemble","on","a","data","(","node","or","link",")","generator",".","It","makes","`","n_predictions","`","for","each","data","point","for","each","of","the","`","n_estimators","`","and","returns","the","mean","and","standard","deviation","of","the","predictions",".","For","detailed","descriptions","of","Keras-specific","parameters","consult","the","Keras","documentation","at","https",":","\/\/keras.io\/models\/sequential\/","Args",":","generator",":","The","generator","object","that",",","if","test_data","is","not","None",",","should","be","one","of","type","GraphSAGENodeGenerator",",","HinSAGENodeGenerator",",","FullBatchNodeGenerator",",","GraphSAGELinkGenerator",",","or","HinSAGELinkGenerator",".","However",",","if","test_data","is","None",",","then","generator","should","be","one","of","type","NodeSequence",",","LinkSequence",",","or","FullBatchSequence",".","test_data","(","None","or","iterable",")",":","If","not","None",",","then","it","is","an","iterable",",","e.g",".","list",",","that","specifies","the","node","IDs","to","evaluate","the","model","on",".","test_targets","(","None","or","iterable",")",":","If","not","None",",","then","it","is","an","iterable",",","e.g",".","list",",","that","specifies","the","target","values","for","the","test_data",".","max_queue_size","(","int",")",":","(","Keras-specific","parameter",")","The","maximum","size","for","the","generator","queue",".","workers","(","int",")",":","(","Keras-specific","parameter",")","The","maximum","number","of","workers","to","use",".","use_multiprocessing","(","bool",")",":","(","Keras-specific","parameter",")","If","True","then","use","process","based","threading",".","verbose","(","int",")",":","(","Keras-specific","parameter",")","The","verbosity","mode","that","should","be","0","or","1","with","the","former","turning","verbosity","off","and","the","latter","on",".","Returns",":","tuple",":","The","mean","and","standard","deviation","of","the","model","metrics","for","the","given","data","."]
code: def evaluate(
      self,
      generator,
      test_data=None,
      test_targets=None,
      max_queue_size=10,
      workers=1,
      use_multiprocessing=False,
      verbose=0,
  ):
      """
      Evaluates the ensemble on a data (node or link) generator. It makes `n_predictions` for each data point for each
      of the `n_estimators` and returns the mean and standard deviation of the predictions.
  
      For detailed descriptions of Keras-specific parameters consult the Keras documentation
      at https://keras.io/models/sequential/
  
      Args:
          generator: The generator object that, if test_data is not None, should be one of type
              GraphSAGENodeGenerator, HinSAGENodeGenerator, FullBatchNodeGenerator, GraphSAGELinkGenerator,
              or HinSAGELinkGenerator. However, if test_data is None, then generator should be one of type
              NodeSequence, LinkSequence, or FullBatchSequence.
          test_data (None or iterable): If not None, then it is an iterable, e.g. list, that specifies the node IDs
              to evaluate the model on.
          test_targets (None or iterable): If not None, then it is an iterable, e.g. list, that specifies the target
              values for the test_data.
          max_queue_size (int): (Keras-specific parameter) The maximum size for the generator queue.
          workers (int): (Keras-specific parameter) The maximum number of workers to use.
          use_multiprocessing (bool): (Keras-specific parameter) If True then use process based threading.
          verbose (int): (Keras-specific parameter) The verbosity mode that should be 0 or 1 with the former turning
              verbosity off and the latter on.
  
      Returns:
          tuple: The mean and standard deviation of the model metrics for the given data.
  
      """
      if test_data is not None and not isinstance(
          generator,
          (
              sg.mapper.GraphSAGENodeGenerator,
              sg.mapper.HinSAGENodeGenerator,
              sg.mapper.FullBatchNodeGenerator,
              sg.mapper.GraphSAGELinkGenerator,
              sg.mapper.HinSAGELinkGenerator,
          ),
      ):
          raise ValueError(
              "({}) generator parameter must be of type GraphSAGENodeGenerator, HinSAGENodeGenerator, FullBatchNodeGenerator, "
              "GraphSAGELinkGenerator, or HinSAGELinkGenerator. Received type {}".format(
                  type(self).__name__, type(generator).__name__
              )
          )
      elif not isinstance(
          generator,
          (
              sg.mapper.NodeSequence,
              sg.mapper.LinkSequence,
              sg.mapper.FullBatchSequence,
              sg.mapper.SparseFullBatchSequence,
          ),
      ):
          raise ValueError(
              "({}) If test_data is None, generator must be one of type NodeSequence, "
              "LinkSequence, FullBatchSequence, or SparseFullBatchSequence "
              "but received object of type {}".format(
                  type(self).__name__, type(generator).__name__
              )
          )
      if test_data is not None and test_targets is None:
          raise ValueError(
              "({}) test_targets not given.".format(type(self).__name__)
          )
  
      data_generator = generator
      if test_data is not None:
          data_generator = generator.flow(test_data, test_targets)
  
      test_metrics = []
      for model in self.models:
          tm = []
          for _ in range(self.n_predictions):
              tm.append(
                  model.evaluate(
                      data_generator,
                      max_queue_size=max_queue_size,
                      workers=workers,
                      use_multiprocessing=use_multiprocessing,
                      verbose=verbose,
                  )  # Keras evaluate_generator returns a scalar
              )
          test_metrics.append(np.mean(tm, axis=0))
  
      # Return the mean and standard deviation of the metrics
      return np.mean(test_metrics, axis=0), np.std(test_metrics, axis=0)
  
imports: from stellargraph.layer import *
  import numpy
  from tensorflow import keras
  from tensorflow.keras.callbacks import EarlyStopping
  import stellargraph
label_desc: Use image node_id 7 for calling the Ensemble obj's underlying member method code with example usage: obj.evaluate(generator, test_data, test_targets, max_queue_size, workers, use_multiprocessing, verbose) and returns: np,  np