Sat May 3 01:51:33 CDT 2008
You know, for linkage clustering and BHC, I've found it a lot easier
to work with an intermediate 1d map of indices and never resize the
distance matrix. I then just remove one element from this map at each
iteration, which is a LOT faster than removing a column and a row from
a matrix. if idxmap were the map, you would be working with
X[idxmap[i], idxmap[j] ] instead of X[i, j]. Also, you could even use
a python list in this case, as they are a lot better for deletions
than an array.
On Fri, May 2, 2008 at 5:47 PM, Keith Goodman <firstname.lastname@example.org> wrote:
> On Fri, May 2, 2008 at 5:38 PM, Charles R Harris
> <email@example.com> wrote:
> > On Fri, May 2, 2008 at 6:24 PM, Keith Goodman <firstname.lastname@example.org> wrote:
> > > How can I make this function faster? It removes the i-th row and
> > > column from an array.
> > >
> > Why do you want to do that?
> Single linkage clustering; x is the distance matrix.
> Numpy-discussion mailing list
UBC Department of Computer Science
More information about the Numpy-discussion