docstr: Tests by handing in predictions which contain NaNs
docstr_tok: ["Tests","by","handing","in","predictions","which","contain","NaNs"]
code: def test_finish_up_model_predicts_NaN(self):
      """Tests by handing in predictions which contain NaNs"""
      rs = np.random.RandomState(1)
  
      queue_mock = unittest.mock.Mock()
      ae = AbstractEvaluator(
          backend=self.backend_mock,
          port=self.port,
          output_y_hat_optimization=False,
          queue=queue_mock,
          metrics=[accuracy],
          additional_components=dict(),
      )
      ae.Y_optimization = rs.rand(33, 3)
      predictions_ensemble = rs.rand(33, 3)
      predictions_test = rs.rand(25, 3)
  
      # NaNs in prediction ensemble
      predictions_ensemble[5, 2] = np.NaN
      _, loss, _, additional_run_info = ae.finish_up(
          loss=0.1,
          train_loss=0.1,
          opt_pred=predictions_ensemble,
          test_pred=predictions_test,
          additional_run_info=None,
          final_call=True,
          file_output=True,
          status=StatusType.SUCCESS,
      )
      self.assertEqual(loss, 1.0)
      self.assertEqual(
          additional_run_info,
          {
              "error": "Model predictions for optimization set contains NaNs."
          },
      )
  
      predictions_ensemble = rs.rand(33, 3)
      predictions_test[5, 2] = np.NaN
      _, loss, _, additional_run_info = ae.finish_up(
          loss=0.1,
          train_loss=0.1,
          opt_pred=predictions_ensemble,
          test_pred=predictions_test,
          additional_run_info=None,
          final_call=True,
          file_output=True,
          status=StatusType.SUCCESS,
      )
      self.assertEqual(loss, 1.0)
      self.assertEqual(
          additional_run_info,
          {"error": "Model predictions for test set contains NaNs."},
      )
      self.assertEqual(
          self.backend_mock.save_predictions_as_npy.call_count, 0
      )
  
imports: import logging.handlers
  import os
  import shutil
  import sys
  import tempfile
  import numpy
  import sklearn.dummy
  from smac.tae import StatusType
  from autosklearn.automl_common.common.utils.backend import Backend, BackendContext
  from autosklearn.evaluation.abstract_evaluator import AbstractEvaluator
  from autosklearn.metrics import accuracy
  from autosklearn.pipeline.components.base import _addons
  import unittest
  import unittest.mock
  from evaluation_util import get_multiclass_classification_datamanager
label_desc: Use image node_id 3 for calling the AbstractEvaluatorTest obj's underlying member method code with example usage: obj.test_finish_up_model_predicts_NaN() without return types