class_docstr: Defing unit tests for CartesianProduct GPs. 
class_docstr_tok: ["Defing","unit","tests","for","CartesianProduct","GPs","."]
docstr: Tests prediction on the training set. 
docstr_tok: ["Tests","prediction","on","the","training","set","."]
code: def _test_prediction(self, Y_test_pred, Y_test, Y_train):
      """Tests prediction on the training set."""
      Y_test_pred = np.array(Y_test_pred)
      Y_test = np.array(Y_test)
      Y_train = np.array(Y_train)
      mean_train_err = self._compute_rmse(Y_test, Y_train.mean())
      mean_test_err = self._compute_rmse(Y_test, Y_test.mean())
      mean_gp_pred_error = self._compute_rmse(Y_test, Y_test_pred)
      test_succ = mean_gp_pred_error < mean_train_err
      test_str = (
          "gp_err=%0.4f, train_mean_err=%0.4f, test_mean_err=%0.4f, succ=%d"
          % (
              mean_gp_pred_error,
              mean_train_err,
              mean_test_err,
              test_succ,
          )
      )
      return test_succ, test_str
  
imports: from argparse import Namespace
  import numpy
  import os
  from time import time
  from ..exd.cp_domain_utils import load_cp_domain_from_config_file, get_processed_func_from_raw_func_for_cp_domain, get_processed_func_from_raw_func_via_config, load_config_file, sample_from_config_space
  from .None import cartesian_product_gp
  from ..test_data.park1_3.park1_3 import park1_3
  from ..test_data.park1_3.park1_3_mf import park1_3_mf
  from ..test_data.park2_4.park2_4 import park2_4
  from ..test_data.park2_4.park2_4_mf import park2_4_mf
  from ..utils.base_test_class import BaseTestClass, execute_tests
  from ..utils.general_utils import map_to_bounds, get_idxs_from_list_of_lists
label_desc: Use image node_id 2 for calling the CPGPTestCaseDefinitions obj's underlying member method code with example usage: obj._test_prediction(Y_test_pred, Y_test, Y_train) and returns: test_succ,  test_str