Emanuele Olivetti wrote:
Hi,
I'm trying to compute the distance matrix (weighted p-norm [*])
between two sets of vectors (data1 and data2). Example:
import numpy as N
p = 3.0
data1 = N.random.randn(100,20)
data2 = N.random.randn(80,20)
weight = N.random.rand(20)
distance_matrix =
Damian Eads wrote:
Emanuele Olivetti wrote:
...
[*] : ||x - x'||_w = (\sum_{i=1...N} (w_i*|x_i - x'_i|)**p)**(1/p)
This feature could be implemented easily. However, I must admit I'm not
very familiar with weighted p-norms. What is the reason for raising w
to the p instead of
Hi there,
The pdist function computes pairwise distances between vectors in a
single collection, storing the distances in a condensed distance matrix.
This is not exactly what you want--you want to compute distance
between two collections of vectors.
Suppose XA is a m_A by n array and XB is
Excellent.
David said that distance computation will be moved in a
separate package soon. I guess that your implementation
will be the suitable one for this package. Am I wrong?
Thanks again,
Emanuele
Damian Eads wrote:
Hi there,
The pdist function computes pairwise distances between
On Sun, Sep 7, 2008 at 4:07 PM, Emanuele Olivetti
[EMAIL PROTECTED] wrote:
David said that distance computation will be moved in a
separate package soon. I guess that your implementation
will be the suitable one for this package. Am I wrong?
Yes, that is correct. David was talking about
David Cournapeau wrote:
Emanuele Olivetti wrote:
Hi,
I'm trying to compute the distance matrix (weighted p-norm [*])
between two sets of vectors (data1 and data2). Example:
You may want to look at scipy.cluster.distance, which has a bunch of
distance matrix implementation. I believe
Emanuele Olivetti wrote:
Thanks for the pointer but the distance subpackage in cluster is about
the distance matrix of vectors in one set of vectors. So the resulting
matrix is symmetric. I need to compute distances between two
different sets of vectors (i.e. a non-symmetric distance matrix).
David Cournapeau wrote:
FWIW, distance is deemed to move to a separate package, because distance
computation is useful in other contexts than clustering.
Excellent. I was thinking about something similar. I'll have a look
to the separate package. Please drop an email to this list when
Hi,
I'm trying to compute the distance matrix (weighted p-norm [*])
between two sets of vectors (data1 and data2). Example:
import numpy as N
p = 3.0
data1 = N.random.randn(100,20)
data2 = N.random.randn(80,20)
weight = N.random.rand(20)
distance_matrix = N.zeros((data1.shape[0],data2.shape[0]))
Emanuele Olivetti wrote:
Hi,
I'm trying to compute the distance matrix (weighted p-norm [*])
between two sets of vectors (data1 and data2). Example:
You may want to look at scipy.cluster.distance, which has a bunch of
distance matrix implementation. I believe most of them have optional
10 matches
Mail list logo