[mlpack-git] master: Add more documentation to the RASearchRules class. (ff5c089)

gitdub at mlpack.org gitdub at mlpack.org
Tue Jul 26 21:22:08 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/ef51b032f275266f781d42b9bd0aa50aa26a3077...8522b04c3d9a82fb7e964bafd72e70f0cd30bf4b

>---------------------------------------------------------------

commit ff5c089ff6a84c9aa8e11006dd05353c7926aabf
Author: MarcosPividori <marcos.pividori at gmail.com>
Date:   Thu Jul 21 13:03:35 2016 -0300

    Add more documentation to the RASearchRules class.


>---------------------------------------------------------------

ff5c089ff6a84c9aa8e11006dd05353c7926aabf
 src/mlpack/methods/rann/ra_search_rules.hpp | 36 +++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/src/mlpack/methods/rann/ra_search_rules.hpp b/src/mlpack/methods/rann/ra_search_rules.hpp
index b04f9bc..c7edeba 100644
--- a/src/mlpack/methods/rann/ra_search_rules.hpp
+++ b/src/mlpack/methods/rann/ra_search_rules.hpp
@@ -16,10 +16,39 @@
 namespace mlpack {
 namespace neighbor {
 
+/**
+ * The RASearchRules class is a template helper class used by RASearch class
+ * when performing rank-approximate search via random-sampling.
+ *
+ * @tparam SortPolicy The sort policy for distances.
+ * @tparam MetricType The metric to use for computation.
+ * @tparam TreeType The tree type to use; must adhere to the TreeType API.
+ */
 template<typename SortPolicy, typename MetricType, typename TreeType>
 class RASearchRules
 {
  public:
+  /**
+   * Construct the RASearchRules object.  This is usually done from within
+   * the RASearch class at search time.
+   *
+   * @param referenceSet Set of reference data.
+   * @param querySet Set of query data.
+   * @param k Number of neighbors to search for.
+   * @param metric Instantiated metric.
+   * @param tau The rank-approximation in percentile of the data.
+   * @param alpha The desired success probability.
+   * @param naive If true, the rank-approximate search will be performed by
+   *      directly sampling the whole set instead of using the stratified
+   *      sampling on the tree.
+   * @param sampleAtLeaves Sample at leaves for faster but less accurate
+   *      computation.
+   * @param firstLeafExact Traverse to the first leaf without approximation.
+   * @param singleSampleLimit The limit on the largest node that can be
+   *     approximated by sampling.
+   * @param sameSet If true, the query and reference set are taken to be the
+   *      same, and a query point will not return itself in the results.
+   */
   RASearchRules(const arma::mat& referenceSet,
                 const arma::mat& querySet,
                 const size_t k,
@@ -41,6 +70,13 @@ class RASearchRules
    */
   void GetResults(arma::Mat<size_t>& neighbors, arma::mat& distances);
 
+  /**
+   * Get the distance from the query point to the reference point.
+   * This will update the list of candidates with the new point if appropriate.
+   *
+   * @param queryIndex Index of query point.
+   * @param referenceIndex Index of reference point.
+   */
   double BaseCase(const size_t queryIndex, const size_t referenceIndex);
 
   /**




More information about the mlpack-git mailing list