I am using scipy.spatial.distance.mahalanobis to calculate distance between two vectors but i'm getting null values for some vector I don't know why? null value is possible?
1 Answer
It is important to include your test cases when you encounter a potential bug.
Without further information, looking at the formula of Mahanologis distance. $$\sqrt{(u-v)^TV^{-1}(u-v)}$$ It is possible to obtain an error if $V$ is not positive definite as the input for the square root might be negative.
-
$\begingroup$ yes right exactly that's what happened in my case, thanks $\endgroup$ Apr 15, 2019 at 5:27