code: def getting_single_predictions_classifier_test():
      np.random.seed(0)
  
      (
          df_titanic_train,
          df_titanic_test,
      ) = utils.get_titanic_binary_classification_dataset()
  
      column_descriptions = {
          "survived": "output",
          "sex": "categorical",
          "embarked": "categorical",
          "pclass": "categorical",
          "age_bucket": "categorical",
      }
  
      ensemble_config = [
          {"model_name": "LGBMClassifier"},
          {"model_name": "RandomForestClassifier"},
      ]
  
      ml_predictor = Predictor(
          type_of_estimator="classifier",
          column_descriptions=column_descriptions,
      )
  
      ml_predictor.train(
          df_titanic_train, ensemble_config=ensemble_config
      )
  
      file_name = ml_predictor.save(str(random.random()))
  
      saved_ml_pipeline = load_ml_model(file_name)
  
      os.remove(file_name)
      try:
          keras_file_name = (
              file_name[:-5] + "_keras_deep_learning_model.h5"
          )
          os.remove(keras_file_name)
      except:
          pass
  
      df_titanic_test_dictionaries = df_titanic_test.to_dict("records")
  
      # 1. make sure the accuracy is the same
  
      predictions = []
      for row in df_titanic_test_dictionaries:
          predictions.append(saved_ml_pipeline.predict_proba(row)[1])
  
      print("predictions")
      print(predictions)
  
      first_score = utils.calculate_brier_score_loss(
          df_titanic_test.survived, predictions
      )
      print("first_score")
      print(first_score)
      # Make sure our score is good, but not unreasonably good
  
      lower_bound = -0.16
  
      assert -0.15 < first_score < -0.135
  
      # 2. make sure the speed is reasonable (do it a few extra times)
      data_length = len(df_titanic_test_dictionaries)
      start_time = datetime.datetime.now()
      for idx in range(1000):
          row_num = idx % data_length
          saved_ml_pipeline.predict(
              df_titanic_test_dictionaries[row_num]
          )
      end_time = datetime.datetime.now()
      duration = end_time - start_time
  
      print("duration.total_seconds()")
      print(duration.total_seconds())
  
      # It's very difficult to set a benchmark for speed that will work across all machines.
      # On my 2013 bottom of the line 15" MacBook Pro, this runs in about 0.8 seconds for 1000 predictions
      # That's about 1 millisecond per prediction
      # Assuming we might be running on a test box that's pretty weak, multiply by 3
      # Also make sure we're not running unreasonably quickly
      assert 0.2 < duration.total_seconds() < 60
  
      # 3. make sure we're not modifying the dictionaries (the score is the same after running a few experiments as it is the first time)
  
      predictions = []
      for row in df_titanic_test_dictionaries:
          predictions.append(saved_ml_pipeline.predict_proba(row)[1])
  
      print("predictions")
      print(predictions)
      print("df_titanic_test_dictionaries")
      print(df_titanic_test_dictionaries)
      second_score = utils.calculate_brier_score_loss(
          df_titanic_test.survived, predictions
      )
      print("second_score")
      print(second_score)
      # Make sure our score is good, but not unreasonably good
  
      assert -0.15 < second_score < -0.135
  
file_path: auto_ml/tests/core_tests/ensemble_tests.py
imports: import datetime
  import os
  import random
  import sys
  from auto_ml import Predictor
  from auto_ml.utils_models import load_ml_model
  from nose.tools import assert_equal, assert_not_equal, with_setup
  from sklearn.metrics import accuracy_score
  import dill
  import numpy
  import utils_testing
label_desc: Use image node_id 3 for calling a global function with example usage: getting_single_predictions_classifier_test() without return types