[mlpack-git] master, mlpack-1.0.x: Fix from Siddharth, fixes #324. (800bee5)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:43:43 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 800bee5bfc44dd1b62c49354e8ed765b569cef0d
Author: Ryan Curtin <ryan at ratml.org>
Date: Tue Feb 11 17:11:44 2014 +0000
Fix from Siddharth, fixes #324.
>---------------------------------------------------------------
800bee5bfc44dd1b62c49354e8ed765b569cef0d
src/mlpack/methods/cf/cf.cpp | 3 +--
src/mlpack/methods/cf/cf.hpp | 1 +
src/mlpack/methods/cf/cf_main.cpp | 3 ++-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/mlpack/methods/cf/cf.cpp b/src/mlpack/methods/cf/cf.cpp
index 0a82595..c8e2487 100644
--- a/src/mlpack/methods/cf/cf.cpp
+++ b/src/mlpack/methods/cf/cf.cpp
@@ -170,8 +170,7 @@ void CF::GetRecommendations(arma::Mat<size_t>& recommendations,
insertPosition--;
}
- // Now insert it into the list, but insert item (j + 1), not item j,
- // because everything is offset.
+ // Now insert it into the list.
InsertNeighbor(i, insertPosition, j, value, recommendations,
values);
}
diff --git a/src/mlpack/methods/cf/cf.hpp b/src/mlpack/methods/cf/cf.hpp
index a48a370..f244363 100644
--- a/src/mlpack/methods/cf/cf.hpp
+++ b/src/mlpack/methods/cf/cf.hpp
@@ -49,6 +49,7 @@ namespace cf /** Collaborative filtering. */{
* should have three rows. The first represents the user; the second represents
* the item; and the third represents the rating. The user and item, while they
* are in a matrix that holds doubles, should hold integer (or size_t) values.
+ * The user and item indices are assumed to be starting from 0.
*/
class CF
{
diff --git a/src/mlpack/methods/cf/cf_main.cpp b/src/mlpack/methods/cf/cf_main.cpp
index c13c0ac..ac18182 100644
--- a/src/mlpack/methods/cf/cf_main.cpp
+++ b/src/mlpack/methods/cf/cf_main.cpp
@@ -28,7 +28,8 @@ PROGRAM_INFO("Collaborating Filtering", "This program performs collaborative "
"The input file should contain a 3-column matrix of ratings, where the "
"first column is the user, the second column is the item, and the third "
"column is that user's rating of that item. Both the users and items "
- "should be numeric indices, not names.");
+ "should be numeric indices, not names. The indices are assumed to start "
+ "from 0.");
// Parameters for program.
PARAM_STRING_REQ("input_file", "Input dataset to perform CF on.", "i");
More information about the mlpack-git
mailing list