[mlpack] How to keep object when searching neighbors?
Ryan Curtin
gth671b at mail.gatech.edu
Thu Jan 16 10:10:10 EST 2014
On Thu, Jan 16, 2014 at 01:15:42PM +0800, Li Dong wrote:
> So the constructor should look like this?
>
> RangeSearch (referenceTree, NULL, referenceSet, querySet, true)
>
> where ‘querySet' is used as the query dataset?
>
> It would be convenient that the reference dataset can be kept across the call of Search(…), and we can pass query dataset when calling Search(…).
I'm still not sure why you're not calling the constructor I suggested,
but what you wrote will work. The RangeSearch object holds a reference
to the querySet matrix (it does not copy it), so you can modify the
querySet matrix between runs and then call Search() and it will still
work. However note that this will *only* work in single-tree mode,
because it does not build a tree on the query points. If a tree was
built on the query points it would be incorrect when you updated the
query points.
Does that help?
--
Ryan Curtin | "Exterminate all rational thought."
ryan at ratml.org | - Bill Lee
More information about the mlpack
mailing list