def _initialize_parameters_kmeans(self, data: torch.Tensor) -> None:
        """Initialize GMM parameters using K-means clustering.

        Args:
            data (torch.Tensor): Input data for initialization.
                Shape: ``(n_samples, n_features)``.
        """
        labels, _ = KMeans(n_clusters=self.n_components).fit(data)
        resp = one_hot(labels, num_classes=self.n_components).float()
        self._m_step(data, resp)
Initialize GMM parameters using K-means clustering.

        Args:
            data (torch.Tensor): Input data for initialization.
                Shape: ``(n_samples, n_features)``.
        
src/anomalib/models/components/cluster/gmm.py