docstr: (Weighted) majority vote model for a given list of Keras models.
  
  Parameters
  ----------
  model_list: An iterable of Keras models.
  voting: Choose 'hard' for straight-up majority vote of highest model probilities or 'soft'
      for a weighted majority vote. In the latter, a weight vector has to be specified.
  weights: Weight vector (numpy array) used for soft majority vote.
  nb_classes: Number of classes being predicted.
  
  Returns
  -------
  A voting model that has a predict method with the same signature of a single keras model.
docstr_tok: ["(","Weighted",")","majority","vote","model","for","a","given","list","of","Keras","models",".","Parameters","--","--","--","--","--","model_list",":","An","iterable","of","Keras","models",".","voting",":","Choose","'hard","'","for","straight-up","majority","vote","of","highest","model","probilities","or","'soft'","for","a","weighted","majority","vote",".","In","the","latter",",","a","weight","vector","has","to","be","specified",".","weights",":","Weight","vector","(","numpy","array",")","used","for","soft","majority","vote",".","nb_classes",":","Number","of","classes","being","predicted",".","Returns","--","--","--","-","A","voting","model","that","has","a","predict","method","with","the","same","signature","of","a","single","keras","model","."]
code: def __init__(
      self, model_list, voting="hard", weights=None, nb_classes=None
  ):
      """(Weighted) majority vote model for a given list of Keras models.
  
      Parameters
      ----------
      model_list: An iterable of Keras models.
      voting: Choose 'hard' for straight-up majority vote of highest model probilities or 'soft'
          for a weighted majority vote. In the latter, a weight vector has to be specified.
      weights: Weight vector (numpy array) used for soft majority vote.
      nb_classes: Number of classes being predicted.
  
      Returns
      -------
      A voting model that has a predict method with the same signature of a single keras model.
      """
      self.model_list = model_list
      self.voting = voting
      self.weights = weights
      self.nb_classes = nb_classes
  
      if voting not in ["hard", "soft"]:
          raise "Voting has to be either hard or soft"
  
      if weights is not None:
          if len(weights) != len(model_list):
              raise (
                  "Number of models {0} and length of weight vector {1} has to match.".format(
                      len(weights), len(model_list)
                  )
              )
  
imports: import numpy
  from keras.models import model_from_yaml
label_desc: Use image node_id 1 to create a new VotingModel object from inherited base classes: object with example: obj = VotingModel(model_list, voting, weights, nb_classes)