[SciPy-user] Calculating a lot of (squared) Mahalanobis distances

David Warde-Farley dwf@cs.toronto....
Fri Nov 7 03:36:22 CST 2008


On 6-Nov-08, at 10:44 PM, Robert Kern wrote:

>> Does anyone have any other tricks up their sleeve?
>
> (xmmu * np.dot(sigmainv, xmmu)).sum(axis=0)

As usual, Robert to the rescue. Thanks!

I'm thinking of modifying scipy.cluster.distance.mahalanobis to  
incorporate this behaviour. Does anyone know why they seem to assume  
row-vectors (the right hand one is transposed rather than the left)?

David


More information about the SciPy-user mailing list