[mlpack] 15/58: Added code example for Reg SVD.

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 9c5d5e03fec2f7d9535005e9234449ceac726e58
Author: siddharth.950 <siddharth.950 at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Mon Aug 18 15:56:22 2014 +0000

    Added code example for Reg SVD.
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@17063 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 .../methods/regularized_svd/regularized_svd.hpp    | 33 ++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/src/mlpack/methods/regularized_svd/regularized_svd.hpp b/src/mlpack/methods/regularized_svd/regularized_svd.hpp
index de2949f..8d7d222 100644
--- a/src/mlpack/methods/regularized_svd/regularized_svd.hpp
+++ b/src/mlpack/methods/regularized_svd/regularized_svd.hpp
@@ -17,6 +17,39 @@
 namespace mlpack {
 namespace svd {
 
+/**
+ * Regularized SVD is a matrix factorization technique that seeks to reduce the 
+ * error on the training set, that is on the examples for which the ratings have
+ * been provided by the users. It is a fairly straightforward technique where
+ * the user and item matrices are updated with the help of Stochastic Gradient
+ * Descent(SGD) updates. The updates also penalize the learning of large feature
+ * values by means of regularization. More details can be found in the following
+ * links:
+ *
+ * http://sifter.org/~simon/journal/20061211.html
+ * http://www.cs.uic.edu/~liub/KDD-cup-2007/proceedings/Regular-Paterek.pdf
+ *
+ * An example of how to use the interface is shown below:
+ *
+ * @code
+ * arma::mat data; // Rating data in the form of coordinate list.
+ *
+ * const size_t rank = 20; // Rank used for the decomposition.
+ * const size_t iterations = 10; // Number of iterations used for optimization.
+ *
+ * const double alpha = 0.01 // Learning rate for the SGD optimizer.
+ * const double lambda = 0.1 // Regularization parameter for the optimization.
+ *
+ * // Make a RegularizedSVD object.
+ * RegularizedSVD<> rSVD(iterations, alpha, lambda);
+ *
+ * arma::mat u, v; // User and item matrices.
+ *
+ * // Use the Apply() method to get a factorization.
+ * rSVD.Apply(data, rank, u, v);
+ * @endcode
+ */
+
 template<
   template<typename> class OptimizerType = mlpack::optimization::SGD
 >

-- 
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