class_docstr: An ensembler using the voting method.
  
  Parameters
  ----------
  ensemble_size : int
      The number of base models selected by the voter. These selected models can be redundant. Default as 10.
class_docstr_tok: ["An","ensembler","using","the","voting","method",".","Parameters","--","--","--","--","--","ensemble_size",":","int","The","number","of","base","models","selected","by","the","voter",".","These","selected","models","can","be","redundant",".","Default","as","10","."]
code: def _specify_weights(self, predictions, label, feval):
      ensemble_prediction = []
      combinations = []
      history = []
  
      for i in range(self.ensemble_size):
          eval_score_full = []
          eval_score = np.zeros([self.n_models])
  
          for j, pred in enumerate(predictions):
              ensemble_prediction.append(pred)
              pred_mean = np.mean(ensemble_prediction, axis=0)
              eval_score_full.append(
                  [
                      fx.evaluate(pred_mean, label)
                      * (1 if fx.is_higher_better else -1)
                      for fx in feval
                  ]
              )
              eval_score[j] = eval_score_full[-1][0]
              ensemble_prediction.pop()
  
          best_model = np.argmax(eval_score)
          ensemble_prediction.append(predictions[best_model])
          history.append(eval_score_full[best_model])
          combinations.append(best_model)
  
      frequency = Counter(combinations).most_common()
      weights = np.zeros([self.n_models])
      for model, freq in frequency:
          weights[model] = float(freq)
  
      weights = weights / np.sum(weights)
  
      return weights
  
file_path: AutoGL/autogl/module/ensemble/voting.py
imports: from collections import Counter
  import numpy
  from .base import BaseEnsembler
  from .None import register_ensembler
  from ...utils import get_logger
label_desc: Use image node_id 4 for calling the Voting obj's underlying member method code with example usage: obj._specify_weights(predictions, label, feval) and returns: weights