[mlpack-git] master: Warn if ratings of 0 are found (b23fdca)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Mon Jan 12 17:15:21 EST 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/660fd96eecf88245555a8651e1cbeff50cd66686...291f2da443b65bce66aaf1f0eeac25d2e6bb6568

>---------------------------------------------------------------

commit b23fdcad358b9edb6862646c47f8e926245da9c5
Author: Stephen Tu <tu.stephenl at gmail.com>
Date:   Sun Jan 11 14:48:29 2015 -0800

    Warn if ratings of 0 are found
    
    these ratings will be ignored


>---------------------------------------------------------------

b23fdcad358b9edb6862646c47f8e926245da9c5
 src/mlpack/methods/cf/cf_impl.hpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mlpack/methods/cf/cf_impl.hpp b/src/mlpack/methods/cf/cf_impl.hpp
index 53b0a05..df3b8b9 100644
--- a/src/mlpack/methods/cf/cf_impl.hpp
+++ b/src/mlpack/methods/cf/cf_impl.hpp
@@ -207,6 +207,9 @@ void CF<FactorizerType>::CleanData(const arma::mat& data)
     locations(1, i) = ((arma::uword) data(0, i));
     locations(0, i) = ((arma::uword) data(1, i));
     values(i) = data(2, i);
+    if (values(i) == 0)
+      Log::Warn << "User rating of 0 ignored for user "
+        << locations(1, i) << ", item " << locations(0, i) << std::endl;
   }
 
   // Find maximum user and item IDs.



More information about the mlpack-git mailing list