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: Method for configuring the model for training. It is a wrapper of the `keras.models.Model.compile` method for
  all models in the ensemble.
  
  For detailed descriptions of Keras-specific parameters consult the Keras documentation
  at https://keras.io/models/sequential/
  
  Args:
      optimizer (Keras optimizer or str): (Keras-specific parameter) The optimizer to use given either as an
          instance of a Keras optimizer or a string naming the optimiser of choice.
      loss (Keras function or str): (Keras-specific parameter) The loss function or string indicating the
          type of loss to use.
      metrics (list or dict): (Keras-specific parameter) List of metrics to be evaluated by each model in
          the ensemble during training and testing. It should be a list for a model with a single output. To
          specify different metrics for different outputs of a multi-output model, you could also pass a
          dictionary.
      loss_weights (None or list): (Keras-specific parameter) Optional list or dictionary specifying scalar
          coefficients (Python floats) to weight the loss contributions of different model outputs. The loss value
          that will be minimized by the model will then be the weighted sum of all individual losses, weighted by
          the loss_weights coefficients. If a list, it is expected to have a 1:1 mapping to the model's outputs.
          If a tensor, it is expected to map output names (strings) to scalar coefficients.
      sample_weight_mode (None, str, list, or dict): (Keras-specific parameter) If you need to do
          timestep-wise sample weighting (2D weights), set this to "temporal".  None defaults to sample-wise
          weights (1D). If the model has multiple outputs, you can use a different  sample_weight_mode on
          each output by passing a dictionary or a list of modes.
      weighted_metrics (list): (Keras-specific parameter) List of metrics to be evaluated and weighted by
          sample_weight or class_weight during training and testing.
docstr_tok: ["Method","for","configuring","the","model","for","training",".","It","is","a","wrapper","of","the","`","keras.models.Model.compile","`","method","for","all","models","in","the","ensemble",".","For","detailed","descriptions","of","Keras-specific","parameters","consult","the","Keras","documentation","at","https",":","\/\/keras.io\/models\/sequential\/","Args",":","optimizer","(","Keras","optimizer","or","str",")",":","(","Keras-specific","parameter",")","The","optimizer","to","use","given","either","as","an","instance","of","a","Keras","optimizer","or","a","string","naming","the","optimiser","of","choice",".","loss","(","Keras","function","or","str",")",":","(","Keras-specific","parameter",")","The","loss","function","or","string","indicating","the","type","of","loss","to","use",".","metrics","(","list","or","dict",")",":","(","Keras-specific","parameter",")","List","of","metrics","to","be","evaluated","by","each","model","in","the","ensemble","during","training","and","testing",".","It","should","be","a","list","for","a","model","with","a","single","output",".","To","specify","different","metrics","for","different","outputs","of","a","multi-output","model",",","you","could","also","pass","a","dictionary",".","loss_weights","(","None","or","list",")",":","(","Keras-specific","parameter",")","Optional","list","or","dictionary","specifying","scalar","coefficients","(","Python","floats",")","to","weight","the","loss","contributions","of","different","model","outputs",".","The","loss","value","that","will","be","minimized","by","the","model","will","then","be","the","weighted","sum","of","all","individual","losses",",","weighted","by","the","loss_weights","coefficients",".","If","a","list",",","it","is","expected","to","have","a","1:1","mapping","to","the","model","'s","outputs",".","If","a","tensor",",","it","is","expected","to","map","output","names","(","strings",")","to","scalar","coefficients",".","sample_weight_mode","(","None",",","str",",","list",",","or","dict",")",":","(","Keras-specific","parameter",")","If","you","need","to","do","timestep-wise","sample","weighting","(","2D","weights",")",",","set","this","to","``","temporal","''",".","None","defaults","to","sample-wise","weights","(","1D",")",".","If","the","model","has","multiple","outputs",",","you","can","use","a","different","sample_weight_mode","on","each","output","by","passing","a","dictionary","or","a","list","of","modes",".","weighted_metrics","(","list",")",":","(","Keras-specific","parameter",")","List","of","metrics","to","be","evaluated","and","weighted","by","sample_weight","or","class_weight","during","training","and","testing","."]
code: def compile(
      self,
      optimizer,
      loss=None,
      metrics=None,
      loss_weights=None,
      sample_weight_mode=None,
      weighted_metrics=None,
  ):
      """
      Method for configuring the model for training. It is a wrapper of the `keras.models.Model.compile` method for
      all models in the ensemble.
  
      For detailed descriptions of Keras-specific parameters consult the Keras documentation
      at https://keras.io/models/sequential/
  
      Args:
          optimizer (Keras optimizer or str): (Keras-specific parameter) The optimizer to use given either as an
              instance of a Keras optimizer or a string naming the optimiser of choice.
          loss (Keras function or str): (Keras-specific parameter) The loss function or string indicating the
              type of loss to use.
          metrics (list or dict): (Keras-specific parameter) List of metrics to be evaluated by each model in
              the ensemble during training and testing. It should be a list for a model with a single output. To
              specify different metrics for different outputs of a multi-output model, you could also pass a
              dictionary.
          loss_weights (None or list): (Keras-specific parameter) Optional list or dictionary specifying scalar
              coefficients (Python floats) to weight the loss contributions of different model outputs. The loss value
              that will be minimized by the model will then be the weighted sum of all individual losses, weighted by
              the loss_weights coefficients. If a list, it is expected to have a 1:1 mapping to the model's outputs.
              If a tensor, it is expected to map output names (strings) to scalar coefficients.
          sample_weight_mode (None, str, list, or dict): (Keras-specific parameter) If you need to do
              timestep-wise sample weighting (2D weights), set this to "temporal".  None defaults to sample-wise
              weights (1D). If the model has multiple outputs, you can use a different  sample_weight_mode on
              each output by passing a dictionary or a list of modes.
          weighted_metrics (list): (Keras-specific parameter) List of metrics to be evaluated and weighted by
              sample_weight or class_weight during training and testing.
  
      """
      for model in self.models:
          model.compile(
              optimizer=optimizer,
              loss=loss,
              metrics=metrics,
              loss_weights=loss_weights,
              sample_weight_mode=sample_weight_mode,
              weighted_metrics=weighted_metrics,
          )
  
      self.metrics_names = self.models[0].metrics_names
  
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 4 for calling the Ensemble obj's underlying member method code with example usage: obj.compile(optimizer, loss, metrics, loss_weights, sample_weight_mode, weighted_metrics) without return types