[mlpack-git] master: Refactor for new NeighborSearch API. (4ea89a8)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Wed Apr 22 16:32:41 EDT 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/8f85309ae9be40e819b301b39c9a940aa28f3bb2...57d0567dddff01feea73b348f38cc040dc3cf8e3

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

commit 4ea89a8946f6a3d2e47910ef1f25ef7fa4685844
Author: ryan <ryan at ratml.org>
Date:   Wed Apr 22 14:18:45 2015 -0400

    Refactor for new NeighborSearch API.


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

4ea89a8946f6a3d2e47910ef1f25ef7fa4685844
 src/mlpack/methods/cf/cf_impl.hpp                   | 4 ++--
 src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mlpack/methods/cf/cf_impl.hpp b/src/mlpack/methods/cf/cf_impl.hpp
index 1ebde00..5c4e53f 100644
--- a/src/mlpack/methods/cf/cf_impl.hpp
+++ b/src/mlpack/methods/cf/cf_impl.hpp
@@ -137,9 +137,9 @@ void CF<FactorizerType>::GetRecommendations(const size_t numRecs,
 
   // Calculate the neighborhood of the queried users.
   // This should be a templatized option.
-  neighbor::AllkNN a(rating, query);
+  neighbor::AllkNN a(rating);
   arma::mat resultingDistances; // Temporary storage.
-  a.Search(numUsersForSimilarity, neighborhood, resultingDistances);
+  a.Search(query, numUsersForSimilarity, neighborhood, resultingDistances);
 
   // Temporary storage for storing the average rating for each user in their
   // neighborhood.
diff --git a/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp b/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp
index 02159ca..b9c9c5b 100644
--- a/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp
+++ b/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp
@@ -107,7 +107,7 @@ double DualTreeKMeans<MetricType, MatType, TreeType>::Iterate(
     Timer::Start("knn");
     // Find the nearest neighbors of each of the clusters.
     neighbor::NeighborSearch<neighbor::NearestNeighborSort, MetricType,
-        TreeType> nns(centroidTree, centroids);
+        TreeType> nns(centroidTree);
     arma::mat interclusterDistancesTemp;
     arma::Mat<size_t> closestClusters; // We don't actually care about these.
     nns.Search(1, closestClusters, interclusterDistancesTemp);



More information about the mlpack-git mailing list