<div class="gmail_extra"><div class="gmail_quote">On Wed, May 2, 2012 at 5:45 PM, Moroney, Catherine M (388D) <span dir="ltr"><<a href="mailto:Catherine.M.Moroney@jpl.nasa.gov" target="_blank">Catherine.M.Moroney@jpl.nasa.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks to Perry for some very useful off-list conversation.   I realize that<br>
I wasn't being clear at all in my earlier description of the problem so here it is<br>
in a nutshell:<br>
<br>
Find the best match in an array t(5000, 7) for a single vector e(7).  Now scale<br>
it up so e is (128, 512, 7) and I want to return a (128, 512) array of the t-identifiers<br>
that are the best match for e.  "Best match" is defined as the minimum Euclidean distance.<br><br></blockquote><div><br></div><div>It sounds like you want to find the nearest neighbor to a point in a high-dimensional space. This sounds like a job for a spacial data structure like a KD-tree.  See:</div>
<div><br></div><div><a href="http://docs.scipy.org/doc/scipy/reference/spatial.html">http://docs.scipy.org/doc/scipy/reference/spatial.html</a></div><div><a href="http://mloss.org/software/view/143/">http://mloss.org/software/view/143/</a></div>
<div><a href="http://www.mrzv.org/software/pyANN/">http://www.mrzv.org/software/pyANN/</a></div><div>etc.</div><div><br></div><div>-Kevin</div><div><br></div><div><br></div></div></div>