code: def evaluate(
      input_directory, validation_files, test_files, ensemble_size=50
  ):
      backend = create(
          temporary_directory=input_directory,
          output_directory=input_directory + "_output",
          delete_tmp_folder_after_terminate=False,
      )
  
      valid_labels = backend.load_targets_ensemble()
      D = backend.load_datamanager()
      test_labels = D.data["Y_test"]
  
      score = balanced_accuracy
  
      # Read the modification time of the predictions file and
      # compute the interval to the first prediction file.
      # This interval will be add to the time we needed to build the ensemble
      time_function_evaluation = validation_files[-1][-1]
  
      # Build the ensemble
      start = time.time()
      ensemble_selection = EnsembleSelection(
          ensemble_size=ensemble_size,
          task_type=D.info["task"],
          metric=score,
          random_state=np.random.RandomState(),
      )
  
      validation_predictions = np.array(
          [v[0] for v in validation_files]
      )
      test_predictions = np.array([t[0] for t in test_files])
  
      ensemble_selection.fit(
          validation_predictions, valid_labels, identifiers=None
      )
      y_hat_ensemble = ensemble_selection.predict(
          np.array(validation_predictions)
      )
      y_hat_test = ensemble_selection.predict(
          np.array(test_predictions)
      )
  
      # Compute validation error
      ensemble_error = 1 - score(valid_labels, y_hat_ensemble)
  
      # Compute test error
      ensemble_test_error = 1 - score(test_labels, y_hat_test)
  
      ensemble_time = time.time() - start
  
      return_value = {
          "ensemble_time": ensemble_time,
          "time_function_evaluation": time_function_evaluation,
          "ensemble_error": ensemble_error,
          "ensemble_test_error": ensemble_test_error,
      }
  
      return return_value
  
file_path: auto-sklearn/scripts/2015_nips_paper/run/score_ensemble.py
imports: from argparse import ArgumentParser
  import csv
  import glob
  import os
  import time
  import joblib
  import numpy
  from autosklearn.ensembles.ensemble_selection import EnsembleSelection
  from autosklearn.metrics import balanced_accuracy
  from autosklearn.automl_common.common.utils.backend import create
label_desc: Use image node_id 4 for calling a global function with example usage: evaluate(input_directory, validation_files, test_files, ensemble_size) and returns: return_value