From 60134147935e76819892aa72fe9604cbde8a856e Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Mon, 14 Apr 2014 18:20:22 +0000 Subject: [PATCH] Add rank parameter. This might not be applicable to when we have other decompositions, though. --- src/mlpack/methods/cf/cf_main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mlpack/methods/cf/cf_main.cpp b/src/mlpack/methods/cf/cf_main.cpp index 7914573f6f..7c873d4522 100644 --- a/src/mlpack/methods/cf/cf_main.cpp +++ b/src/mlpack/methods/cf/cf_main.cpp @@ -51,6 +51,8 @@ PARAM_INT("recommendations", "Number of recommendations to generate for each " 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 @@ int main(int argc, char** argv) // Get parameters. const size_t numRecs = (size_t) CLI::GetParam("recommendations"); const size_t neighborhood = (size_t) CLI::GetParam("neighborhood"); + const size_t rank = (size_t) CLI::GetParam("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("query_file");