[mlpack-svn] r16421 - mlpack/trunk/src/mlpack/methods/cf

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Apr 14 14:20:23 EDT 2014


Author: rcurtin
Date: Mon Apr 14 14:20:22 2014
New Revision: 16421

Log:
Add rank parameter.  This might not be applicable to when we have other
decompositions, though.


Modified:
   mlpack/trunk/src/mlpack/methods/cf/cf_main.cpp

Modified: mlpack/trunk/src/mlpack/methods/cf/cf_main.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/cf/cf_main.cpp	(original)
+++ mlpack/trunk/src/mlpack/methods/cf/cf_main.cpp	Mon Apr 14 14:20:22 2014
@@ -51,6 +51,8 @@
 PARAM_INT("neighborhood", "Size of the neighborhood of similar users to "
     "consider for each query user.", "n", 5);
 
+PARAM_INT("rank", "Rank of decomposed matrices.", "R", 2);
+
 int main(int argc, char** argv)
 {
   // Parse command line options.
@@ -67,11 +69,13 @@
   // Get parameters.
   const size_t numRecs = (size_t) CLI::GetParam<int>("recommendations");
   const size_t neighborhood = (size_t) CLI::GetParam<int>("neighborhood");
+  const size_t rank = (size_t) CLI::GetParam<int>("rank");
 
   // Perform decomposition to prepare for recommendations.
   Log::Info << "Performing CF matrix decomposition on dataset..." << endl;
   CF<> c(dataset);
   c.NumUsersForSimilarity(neighborhood);
+  c.Rank(rank);
 
   // Reading users.
   const string queryFile = CLI::GetParam<string>("query_file");



More information about the mlpack-svn mailing list