docstr: Configure the reference data split. If the randomly selected split causes an initial detection, further splits
  are attempted.
docstr_tok: ["Configure","the","reference","data","split",".","If","the","randomly","selected","split","causes","an","initial","detection",",","further","splits","are","attempted","."]
code: def _configure_ref_subset(self):
      """
      Configure the reference data split. If the randomly selected split causes an initial detection, further splits
      are attempted.
      """
      etw_size = 2 * self.window_size - 1  # etw = extended test window
      rw_size = self.n - etw_size  # rw = ref window#
      # Make split and ensure it doesn't cause an initial detection
      mmd_init = None
      while mmd_init is None or mmd_init >= self.get_threshold(0):
          # Make split
          perm = tf.random.shuffle(tf.range(self.n))
          self.ref_inds, self.init_test_inds = (
              perm[:rw_size],
              perm[-self.window_size :],
          )
          # Compute initial mmd to check for initial detection
          self._initialise_state()  # to set self.test_window and self.k_xtc
          self.k_xx_sub = subset_matrix(
              self.k_xx, self.ref_inds, self.ref_inds
          )
          self.k_xx_sub_sum = tf.reduce_sum(
              zero_diag(self.k_xx_sub)
          ) / (rw_size * (rw_size - 1))
          k_yy = self.kernel(self.test_window, self.test_window)
          mmd_init = (
              self.k_xx_sub_sum
              + tf.reduce_sum(zero_diag(k_yy))
              / (self.window_size * (self.window_size - 1))
              - 2 * tf.reduce_mean(self.k_xy)
          )
  
file_path: alibi-detect/alibi_detect/cd/tensorflow/mmd_online.py
imports: from tqdm import tqdm
  import numpy
  import tensorflow
  from typing import Any, Callable, Optional, Union
  from alibi_detect.cd.base_online import BaseMultiDriftOnline
  from alibi_detect.utils.tensorflow.kernels import GaussianRBF
  from alibi_detect.utils.tensorflow import zero_diag, quantile, subset_matrix
  from alibi_detect.utils.frameworks import Framework
label_desc: Use image node_id 3 for calling the MMDDriftOnlineTF obj's underlying member method code with example usage: obj._configure_ref_subset() without return types