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: Args:
      model: A keras model.
      n_estimators (int):  The number of estimators (aka models) in the ensemble.
      n_predictions (int):  The number of predictions per query point per estimator
docstr_tok: ["Args",":","model",":","A","keras","model",".","n_estimators","(","int",")",":","The","number","of","estimators","(","aka","models",")","in","the","ensemble",".","n_predictions","(","int",")",":","The","number","of","predictions","per","query","point","per","estimator"]
code: def __init__(self, model, n_estimators=3, n_predictions=3):
      """
  
      Args:
          model: A keras model.
          n_estimators (int):  The number of estimators (aka models) in the ensemble.
          n_predictions (int):  The number of predictions per query point per estimator
      """
      if not isinstance(model, K.Model):
          raise ValueError(
              "({}) model must be a Keras model received object of type {}".format(
                  type(self).__name__, type(model).__name__
              )
          )
      if n_estimators <= 0 or not isinstance(n_estimators, int):
          raise ValueError(
              "({}) n_estimators must be positive integer but received {}".format(
                  type(self).__name__, n_estimators
              )
          )
  
      if n_predictions <= 0 or not isinstance(n_predictions, int):
          raise ValueError(
              "({}) n_predictions must be positive integer but received {}".format(
                  type(self).__name__, n_predictions
              )
          )
  
      self.metrics_names = None  # It will be set when the self.compile() method is called
      self.models = []
      self.history = []
      self.n_estimators = n_estimators
      self.n_predictions = n_predictions
      self.early_stoppping_patience = 10
  
      # Create the enseble from the given base model
      self._init_models(model)
  
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 1 to create a new Ensemble object from inherited base classes: object with example: obj = Ensemble(model, n_estimators, n_predictions)