[mlpack-svn] r15884 - mlpack/trunk/src/mlpack/methods/cf
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Sep 30 22:26:44 EDT 2013
Author: rcurtin
Date: Mon Sep 30 22:26:44 2013
New Revision: 15884
Log:
The very large and dense 'mask' matrix is now unnecessary.
Modified:
mlpack/trunk/src/mlpack/methods/cf/cf.cpp
mlpack/trunk/src/mlpack/methods/cf/cf.hpp
Modified: mlpack/trunk/src/mlpack/methods/cf/cf.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/cf/cf.cpp (original)
+++ mlpack/trunk/src/mlpack/methods/cf/cf.cpp Mon Sep 30 22:26:44 2013
@@ -152,13 +152,8 @@
const size_t maxItemID = (size_t) max(locations.row(0)) + 1;
const size_t maxUserID = (size_t) max(locations.row(1)) + 1;
- // Fill sparse matrix and mask matrix.
+ // Fill sparse matrix.
cleanedData = arma::sp_mat(locations, values, maxItemID, maxUserID);
- mask = arma::ones<arma::mat>((size_t) maxItemID,
- (size_t) maxUserID);
- // Populate mask.
- for (size_t i = 0; i < data.n_cols; i++)
- mask(data(1, i) - 1, data(0, i) - 1) = -1.0;
}
void CF::Query(arma::Mat<size_t>& recommendations,
Modified: mlpack/trunk/src/mlpack/methods/cf/cf.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/cf/cf.hpp (original)
+++ mlpack/trunk/src/mlpack/methods/cf/cf.hpp Mon Sep 30 22:26:44 2013
@@ -186,8 +186,6 @@
arma::mat h;
//! Rating Martix.
arma::mat rating;
- //! Masking Matrix
- arma::mat mask;
//! Initial Data Matrix.
arma::mat data;
//! Cleaned Data Matrix.
More information about the mlpack-svn
mailing list