[SciPy-Dev] scipy.spatial comments

Ralf Gommers ralf.gommers@googlemail....
Sat Mar 10 03:53:31 CST 2012


On Thu, Mar 8, 2012 at 1:40 PM, Jaakko Luttinen <jaakko.luttinen@aalto.fi>wrote:

> Hi!
>
> I have two comments about scipy.spatial distance functions.
>
> First, scipy/spatial/src/distance.c contains several interesting
> distance measures. However, the vector versions are not visible outside
> the file because they are not declared in distance.h (for instance,
> euclidean_distance). Only the pdist_* and cdist_* versions are made
> visible. I would like to use the "raw" distance measures directly for
> some other functions, so would it be ok to introduce those in distance.h?
>

I don't see a problem with that.


> Second, squared Euclidean distance is computed by taking the square of
> the Euclidean distance. I think it would make more sense to do it the
> other way around: the Euclidean distance is computed by taking the
> square root of the squared Euclidean distance.
>

Makes sense, should be a little faster.

>
> If these suggestions are ok, I can try to implement them or how should I
> proceed? Or any other comments?
>

Implementing them and sending a pull request would be good.

If you're familiar with these metrics, perhaps you also have an opinion on
these two tickets:
http://projects.scipy.org/scipy/ticket/1484
http://projects.scipy.org/scipy/ticket/1486
It seems that the definition of a couple of the metrics is incorrect.

Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20120310/7ff585a6/attachment.html 


More information about the SciPy-Dev mailing list