code: def test_loo_likelihood(self):
      for bw in np.logspace(-1, -0.1, 5):
          self.sm_kde.bw = np.array([bw] * len(self.var_types))
          self.hp_kde_full.set_bandwidths(
              np.array([bw] * len(self.var_types))
          )
          self.hp_kde_factor.set_bandwidths(
              np.array([bw] * len(self.var_types))
          )
  
          sm_full_ll = self.sm_kde.loo_likelihood(
              bw=np.array([bw] * len(self.var_types)), func=np.log
          )
          hp_full_ll = self.hp_kde_full.loo_negloglikelihood()
          hp_factor_ll = self.hp_kde_factor.loo_negloglikelihood()
  
          sm_factor_ll = []
          for i, kde in enumerate(self.sm_1d_kdes):
              kde.bw = np.array([bw])
              sm_factor_ll.append(
                  kde.loo_likelihood(bw=np.array([bw]), func=np.log)
              )
  
          sm_factor_ll = np.array(sm_factor_ll)
          n = self.x_train.shape[0]
          delta = 1e-2 * np.abs((sm_full_ll + hp_full_ll) / 2)
          # note: statsmodels' ll is not normalized, so we have to transform our result to get the same number!
          self.assertAlmostEqual(
              sm_full_ll, n * (hp_full_ll - np.log(n - 1)), delta=delta
          )
          # same here, but it is easier to apply the normalization to the SM KDE's likelihoods
          delta = 1e-2 * np.abs(hp_factor_ll)
          self.assertAlmostEqual(
              np.sum((sm_factor_ll / n) + np.log(n - 1)),
              hp_factor_ll,
              delta=delta,
          )
  
imports: import os
  import unittest
  import numpy
  import statsmodels.api
  import ConfigSpace
  from hpbandster.optimizers.kde.mvkde import MultivariateKDE
  from pdb import set_trace
label_desc: Use image node_id 6 for calling the BaseNdTest obj's underlying member method code with example usage: obj.test_loo_likelihood() without return types