[mlpack-git] master, mlpack-1.0.x: Add rank parameter. This might not be applicable to when we have other decompositions, though. (6013414)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:46:10 EST 2015
Repository : https://github.com/mlpack/mlpack
On branches: master,mlpack-1.0.x
Link : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40
>---------------------------------------------------------------
commit 60134147935e76819892aa72fe9604cbde8a856e
Author: Ryan Curtin <ryan at ratml.org>
Date: Mon Apr 14 18:20:22 2014 +0000
Add rank parameter. This might not be applicable to when we have other
decompositions, though.
>---------------------------------------------------------------
60134147935e76819892aa72fe9604cbde8a856e
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 7914573..7c873d4 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<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-git
mailing list