From e8e3aabfa5d2dc68e6af298ba8b4b3b3af582fba Mon Sep 17 00:00:00 2001 From: zxdawn Date: Thu, 16 Oct 2025 15:18:58 +0200 Subject: [PATCH] use pseudo-inverse --- spectral/algorithms/algorithms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spectral/algorithms/algorithms.py b/spectral/algorithms/algorithms.py index 567a5c5..b9990f1 100644 --- a/spectral/algorithms/algorithms.py +++ b/spectral/algorithms/algorithms.py @@ -745,9 +745,9 @@ def cov(self, C): @property def inv_cov(self): - '''Property method returning the inverse of the covariance matrix.''' + '''Property method returning the pseudo-inverse of the covariance matrix.''' if self._inv_cov is None: - self._inv_cov = np.linalg.inv(self._cov) + self._inv_cov = np.linalg.pinv(self._cov) return self._inv_cov def reset_derived_stats(self):