def fit(self, x: np.ndarray, y: np.ndarray, batch_size: int = 128, nb_epochs: int = 20, **kwargs) -> None:
        """
        Determine a threshold that covers 95% of clean samples.

        :param x: Clean sample data
        :param y: Clean sample labels (not used in this method)
        :param batch_size: Batch size for processing
        :param nb_epochs: Number of training epochs (not used in this method)
        """
        clean_metrics = self._get_metrics(x=x, batch_size=batch_size)
        k_minus_one_metrics = clean_metrics[:, self.var_K - 1]
        self.threshold = np.percentile(k_minus_one_metrics, q=self.percentile)

        Determine a threshold that covers 95% of clean samples.

        :param x: Clean sample data
        :param y: Clean sample labels (not used in this method)
        :param batch_size: Batch size for processing
        :param nb_epochs: Number of training epochs (not used in this method)
        
art/defences/detector/evasion/beyond_detector.py