[SciPy-dev] Implementing a distance matrix between two sets of vectors concept
Tue Jul 3 13:10:02 CDT 2007
I've rolled my own in the past. If the vectors are really large and you are
holding a collection of them, you probably want to use a sparse matrix data
structure in either numpy or C.
On 7/3/07, Bill Baxter <email@example.com> wrote:
> I would use it.
> I only need Euclidean distance,
> Python API only is ok.
> Data-types: float and double would do it for me. Double only if it's too
> much effort to do both.
> Order -- all combos of F and C both would be nice, but not critical
> Strides -- with strides better than without, but not critical
> nan -- don't need it.
> On 7/3/07, David Cournapeau < firstname.lastname@example.org> wrote:
> > Hi,
> > for my machine learning toolbox, I need the concept of distance
> > matrix, that is for two sets of vectors v and u (N u and M v), of
> > dimension d, I want to compute the matrix D such as d(i,j) =
> > distance(v_i, u_j). This is easy to do in numpy, but for big datasets,
> > this becomes difficult without a significance loss of efficiency or big
> > memory consumption.
> > So I am thinking about implementing it in C. I think the overall
> > concept is useful for other people, so before implementing something, I
> > was wondering if other people would need/use it, and what would they
> > need:
> > - several distance (Euclidian, Mahalanobis, etc...), which would be
> > a separate object to handle different sets of parameters.
> > - C Api ?
> > - datatypes ? Layout ? Contiguity ?
> > - handling Nan ?
> > cheers,
> > David
> > _______________________________________________
> > Scipy-dev mailing list
> > Scipyemail@example.com
> > http://projects.scipy.org/mailman/listinfo/scipy-dev
> Scipy-dev mailing list
Peter N. Skomoroch
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Scipy-dev