def _cov_and_inv(self, n, indices):
"""
Calculate covariance around local support vector
and also the inverse
"""
cov = self._cov(indices, n)
det = la.det(cov)
while det <= 0:
cov += sp.identity(cov.shape[0]) * self.EPS
det = la.det(cov)
inv_cov = la.inv(cov)
return cov, inv_cov, det
评论列表
文章目录