class_docstr: Processor for selecting the most suitable model (i.e. the predictions
  thereof) from a multiple models/predictions.
  
  Parameters
  ----------
  num_ref_predictions : int
      Number of reference predictions (see below).
  
  Notes
  -----
  This processor selects the most suitable prediction from multiple models by
  comparing them to the predictions of a reference model. The one with the
  smallest mean squared error is chosen.
  
  If `num_ref_predictions` is 0 or None, an averaged prediction is computed
  from the given predictions and used as reference.
  
  References
  ----------
  .. [1] Sebastian Böck, Florian Krebs and Gerhard Widmer,
         "A Multi-Model Approach to Beat Tracking Considering Heterogeneous
         Music Styles",
         Proceedings of the 15th International Society for Music Information
         Retrieval Conference (ISMIR), 2014.
  
  Examples
  --------
  The MultiModelSelectionProcessor takes a list of model predictions as it's
  call argument. Thus, `post_processor` of `RNNBeatProcessor` hast to be set
  to 'None' in order to get the predictions of all models.
  
  >>> proc = RNNBeatProcessor(post_processor=None)
  >>> proc  # doctest: +ELLIPSIS
  <madmom.features.beats.RNNBeatProcessor object at 0x...>
  
  When passing a file through the processor, a list with predictions, one for
  each model tested, is returned.
  
  >>> predictions = proc('tests/data/audio/sample.wav')
  >>> predictions  # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
  [array([0.00535, 0.00774, ..., 0.02343, 0.04931], dtype=float32),
   array([0.0022 , 0.00282, ..., 0.00825, 0.0152 ], dtype=float32),
   ...,
   array([0.005  , 0.0052 , ..., 0.00472, 0.01524], dtype=float32),
   array([0.00319, 0.0044 , ..., 0.0081 , 0.01498], dtype=float32)]
  
  We can feed these predictions to the MultiModelSelectionProcessor.
  Since we do not have a dedicated reference prediction (which had to be the
  first element of the list and `num_ref_predictions` set to 1), we simply
  set `num_ref_predictions` to 'None'. MultiModelSelectionProcessor averages
  all predictions to obtain a reference prediction it compares all others to.
  
  >>> mm_proc = MultiModelSelectionProcessor(num_ref_predictions=None)
  >>> mm_proc(predictions)  # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
  array([0.00759, 0.00901, ..., 0.00843, 0.01834], dtype=float32)
class_docstr_tok: ["Processor","for","selecting","the","most","suitable","model","(","i.e",".","the","predictions","thereof",")","from","a","multiple","models\/predictions",".","Parameters","--","--","--","--","--","num_ref_predictions",":","int","Number","of","reference","predictions","(","see","below",")",".","Notes","--","--","-","This","processor","selects","the","most","suitable","prediction","from","multiple","models","by","comparing","them","to","the","predictions","of","a","reference","model",".","The","one","with","the","smallest","mean","squared","error","is","chosen",".","If","`","num_ref_predictions","`","is","0","or","None",",","an","averaged","prediction","is","computed","from","the","given","predictions","and","used","as","reference",".","References","--","--","--","--","--","..","[","1","]","Sebastian","B\u00f6ck",",","Florian","Krebs","and","Gerhard","Widmer",",","``","A","Multi-Model","Approach","to","Beat","Tracking","Considering","Heterogeneous","Music","Styles","''",",","Proceedings","of","the","15th","International","Society","for","Music","Information","Retrieval","Conference","(","ISMIR",")",",","2014",".","Examples","--","--","--","--","The","MultiModelSelectionProcessor","takes","a","list","of","model","predictions","as","it's","call","argument",".","Thus",",","`","post_processor","`","of","`","RNNBeatProcessor","`","hast","to","be","set","to","'None","'","in","order","to","get","the","predictions","of","all","models",".",">",">",">","proc","=","RNNBeatProcessor","(","post_processor=None",")",">",">",">","proc","#","doctest",":","+ELLIPSIS","<","madmom.features.beats.RNNBeatProcessor","object","at","0x","...",">","When","passing","a","file","through","the","processor",",","a","list","with","predictions",",","one","for","each","model","tested",",","is","returned",".",">",">",">","predictions","=","proc","(","'tests\/data\/audio\/sample.wav","'",")",">",">",">","predictions","#","doctest",":","+NORMALIZE_WHITESPACE","+ELLIPSIS","[","array","(","[","0.00535",",","0.00774",",","...",",","0.02343",",","0.04931","]",",","dtype=float32",")",",","array","(","[","0.0022",",","0.00282",",","...",",","0.00825",",","0.0152","]",",","dtype=float32",")",",","...",",","array","(","[","0.005",",","0.0052",",","...",",","0.00472",",","0.01524","]",",","dtype=float32",")",",","array","(","[","0.00319",",","0.0044",",","...",",","0.0081",",","0.01498","]",",","dtype=float32",")","]","We","can","feed","these","predictions","to","the","MultiModelSelectionProcessor",".","Since","we","do","not","have","a","dedicated","reference","prediction","(","which","had","to","be","the","first","element","of","the","list","and","`","num_ref_predictions","`","set","to","1",")",",","we","simply","set","`","num_ref_predictions","`","to","'None","'",".","MultiModelSelectionProcessor","averages","all","predictions","to","obtain","a","reference","prediction","it","compares","all","others","to",".",">",">",">","mm_proc","=","MultiModelSelectionProcessor","(","num_ref_predictions=None",")",">",">",">","mm_proc","(","predictions",")","#","doctest",":","+NORMALIZE_WHITESPACE","+ELLIPSIS","array","(","[","0.00759",",","0.00901",",","...",",","0.00843",",","0.01834","]",",","dtype=float32",")"]
docstr: Selects the most appropriate predictions form the list of predictions.
  
  Parameters
  ----------
  predictions : list
      Predictions (beat activation functions) of multiple models.
  
  Returns
  -------
  numpy array
      Most suitable prediction.
  
  Notes
  -----
  The reference beat activation function must be the first one in the
  list of given predictions.
docstr_tok: ["Selects","the","most","appropriate","predictions","form","the","list","of","predictions",".","Parameters","--","--","--","--","--","predictions",":","list","Predictions","(","beat","activation","functions",")","of","multiple","models",".","Returns","--","--","--","-","numpy","array","Most","suitable","prediction",".","Notes","--","--","-","The","reference","beat","activation","function","must","be","the","first","one","in","the","list","of","given","predictions","."]
code: def process(self, predictions, **kwargs):
      """
      Selects the most appropriate predictions form the list of predictions.
  
      Parameters
      ----------
      predictions : list
          Predictions (beat activation functions) of multiple models.
  
      Returns
      -------
      numpy array
          Most suitable prediction.
  
      Notes
      -----
      The reference beat activation function must be the first one in the
      list of given predictions.
  
      """
      # TODO: right now we only have 1D predictions, what to do with
      #       multi-dim?
      num_refs = self.num_ref_predictions
      # determine the reference prediction
      if num_refs in (None, 0):
          # just average all predictions to simulate a reference network
          reference = average_predictions(predictions)
      elif num_refs > 0:
          # average the reference predictions
          reference = average_predictions(predictions[:num_refs])
      else:
          raise ValueError(
              "`num_ref_predictions` must be positive or None, "
              "%s given" % num_refs
          )
      # init the error with the max. possible value (i.e. prediction length)
      best_error = len(reference)
      # init the best_prediction with an empty array
      best_prediction = np.empty(0)
      # compare the (remaining) predictions with the reference prediction
      for prediction in predictions[num_refs:]:
          # calculate the squared error w.r.t. the reference prediction
          error = np.sum((prediction - reference) ** 2.0)
          # chose the best activation
          if error < best_error:
              best_prediction = prediction
              best_error = error
      # return the best prediction
      return best_prediction.ravel()
  
imports: from __future__ import absolute_import, division, print_function
  import sys
  import numpy
  from ..audio.signal import signal_frame, smooth
  from ..ml.nn import average_predictions
  from ..processors import OnlineProcessor, ParallelProcessor, Processor, SequentialProcessor
label_desc: Use image node_id 2 for calling the MultiModelSelectionProcessor obj's underlying member method code with example usage: obj.process(predictions) and returns: best_prediction