def __init__(self, metric=None):
        """Create a new instance.

        Args:
            metric (ndarray, optional): PSD matrix that defines a
                Mahalanobis-type pseudo distance. If None, defaults to the
                Mahalanobis matrix. Shape (n_features, n_features).
        """
        self.metric = metric  # metric matrix
        self.has_custom_metric = False if self.metric is None else True
        self.gram = None
        self.min_size = 2
Create a new instance.

        Args:
            metric (ndarray, optional): PSD matrix that defines a
                Mahalanobis-type pseudo distance. If None, defaults to the
                Mahalanobis matrix. Shape (n_features, n_features).
        
src/ruptures/costs/costml.py