def cleanup(self, samples, config, eval_key):
        """Cleans up the results of the evaluation metric with the given key
        from the collection.

        Args:
            samples: a :class:`fiftyone.core.collections.SampleCollection`
            config: an :class:`fiftyone.core.evaluation.EvaluationMethodConfig`
            eval_key: an evaluation key
        """
        dataset = samples._dataset
        for metric_field in self.get_fields(samples, config, eval_key):
            metric_field, is_frame_field = samples._handle_frame_field(
                metric_field
            )
            if is_frame_field:
                dataset.delete_frame_field(metric_field, error_level=1)
            else:
                dataset.delete_sample_field(metric_field, error_level=1)
Cleans up the results of the evaluation metric with the given key
        from the collection.

        Args:
            samples: a :class:`fiftyone.core.collections.SampleCollection`
            config: an :class:`fiftyone.core.evaluation.EvaluationMethodConfig`
            eval_key: an evaluation key
        
fiftyone/operators/evaluation_metric.py