[mlpack-git] [mlpack/mlpack] Resetting stats in NeighborSearch. (#672)

MarcosPividori notifications at github.com
Fri Jun 3 10:53:05 EDT 2016


Maybe it is clearer this way:

"We should reset the stats in the query tree every time we reuse it to do KNN."

Why? Because we could be searching in a different reference dataset, or with a different value of k. Both of these situations mean different values for the bounds.

We have 3 Search() methods in NeighborSearch class:

+ When doing monochromatic search the query tree is properly resetted because 
the query tree is the same than the reference tree. So, everyhing is ok.
```
void Search(const size_t k,
              arma::Mat<size_t>& neighbors,
              arma::mat& distances);
```

+ When we search with different query and reference sets:
   - If we create a query tree inside, we have no problem, because new tree implies proper stats:
```
void Search(const MatType& querySet,
              const size_t k,
              arma::Mat<size_t>& neighbors,
              arma::mat& distances);
```

  - If we receive a query tree, we don't know the state of stats there... This is the special case I am talking about:
```
void Search(Tree* queryTree,
              const size_t k,
              arma::Mat<size_t>& neighbors,
              arma::mat& distances);
```

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/issues/672#issuecomment-223600958
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160603/0c54cafa/attachment.html>


More information about the mlpack-git mailing list