[mlpack] 10/58: Minor documentation changes in CF.

Barak A. Pearlmutter barak+git at cs.nuim.ie
Tue Sep 9 13:19:39 UTC 2014


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch svn-trunk
in repository mlpack.

commit 65d11d8ac1be27eb4550c4954c5198ba09b0b14d
Author: siddharth.950 <siddharth.950 at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Sun Aug 17 10:20:49 2014 +0000

    Minor documentation changes in CF.
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@17055 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 src/mlpack/methods/cf/cf.hpp                           |  2 +-
 src/mlpack/methods/cf/cf_impl.hpp                      | 17 +++++++++++++++--
 src/mlpack/methods/regularized_svd/regularized_svd.hpp |  2 +-
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/mlpack/methods/cf/cf.hpp b/src/mlpack/methods/cf/cf.hpp
index edca85f..0312ccb 100644
--- a/src/mlpack/methods/cf/cf.hpp
+++ b/src/mlpack/methods/cf/cf.hpp
@@ -38,7 +38,7 @@ class FactorizerTraits
    * If true, then the passed data matrix is used for factorizer.Apply().
    * Otherwise, it is modified into a form suitable for factorization.
    */
-  static const bool IsCleaned = false;
+  static const bool UsesCoordinateList = false;
 };
 
 /**
diff --git a/src/mlpack/methods/cf/cf_impl.hpp b/src/mlpack/methods/cf/cf_impl.hpp
index 18403a3..c455018 100644
--- a/src/mlpack/methods/cf/cf_impl.hpp
+++ b/src/mlpack/methods/cf/cf_impl.hpp
@@ -12,6 +12,12 @@
 namespace mlpack {
 namespace cf {
 
+/**
+ * This function is used to factorize the rating matrix into the user and item
+ * matrices, when UsesCoordinateList of property of the factorizer is set to
+ * false. It uses the cleaned rating matrix instead of a (user, item, rating)
+ * list.
+ */
 template<typename FactorizerType>
 void ApplyFactorizer(arma::mat& data,
     arma::sp_mat& cleanedData,
@@ -20,11 +26,17 @@ void ApplyFactorizer(arma::mat& data,
     arma::mat& w,
     arma::mat& h,
     const typename boost::enable_if_c<
-    FactorizerTraits<FactorizerType>::IsCleaned == false, int*>::type = 0)
+        FactorizerTraits<FactorizerType>::UsesCoordinateList == false,
+        int*>::type = 0)
 {
   factorizer.Apply(cleanedData, rank, w, h);
 }
 
+/**
+ * This function is used to factorize the rating matrix into the user and item
+ * matrices, when UsesCoordinateList of property of the factorizer is set to
+ * true. It uses the (user, item, rating) list for factorization.
+ */
 template<typename FactorizerType>
 void ApplyFactorizer(arma::mat& data,
     arma::sp_mat& cleanedData,
@@ -33,7 +45,8 @@ void ApplyFactorizer(arma::mat& data,
     arma::mat& w,
     arma::mat& h,
     const typename boost::enable_if_c<
-    FactorizerTraits<FactorizerType>::IsCleaned == true, int*>::type = 0)
+        FactorizerTraits<FactorizerType>::UsesCoordinateList == true,
+        int*>::type = 0)
 {
   factorizer.Apply(data, rank, w, h);
 }
diff --git a/src/mlpack/methods/regularized_svd/regularized_svd.hpp b/src/mlpack/methods/regularized_svd/regularized_svd.hpp
index a602540..de2949f 100644
--- a/src/mlpack/methods/regularized_svd/regularized_svd.hpp
+++ b/src/mlpack/methods/regularized_svd/regularized_svd.hpp
@@ -72,7 +72,7 @@ class FactorizerTraits<mlpack::svd::RegularizedSVD<> >
 {
  public:
   //! Data provided to RegularizedSVD need not be cleaned.
-  static const bool IsCleaned = true;
+  static const bool UsesCoordinateList = true;
 };
 
 }; // namespace cf

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git



More information about the debian-science-commits mailing list