[mlpack-git] master: Minor documentation changes in CF. (b8cdc72)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:58:23 EST 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40
>---------------------------------------------------------------
commit b8cdc72de9a2ca3f75494a93387d9e32ab10a67e
Author: Siddharth Agrawal <siddharth.950 at gmail.com>
Date: Sun Aug 17 10:20:49 2014 +0000
Minor documentation changes in CF.
>---------------------------------------------------------------
b8cdc72de9a2ca3f75494a93387d9e32ab10a67e
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
More information about the mlpack-git
mailing list