def METHOD_NAME(self, X: Input) -> Target:
    """Predict the class labels for the provided data.
    Args:
        X: FDataGrid with the test samples.
    Returns:
        Array of shape (n_samples) or
            (n_samples, n_outputs) with class labels for each data sample.
    """
    check_is_fitted(self)
    return self.classes_[  # type: ignore[no-any-return]
        PairwiseMetric(self.metric)(
            X,
            self.centroids_,
        ).argmin(axis=1)
    ]