[mlpack-svn] r15875 - 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 15:43:00 EDT 2013


Author: rcurtin
Date: Mon Sep 30 15:43:00 2013
New Revision: 15875

Log:
Remove GenerateRating() function because it's only one line and only used in one
place.


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 15:43:00 2013
@@ -89,8 +89,8 @@
       HAlternatingLeastSquaresRule> als(10000, 1e-5);
   als.Apply(cleanedData, rank, w, h);
 
-  //Generate new table by multiplying approximate values
-  GenerateRating();
+  // Generate new table by multiplying approximate values.
+  rating = w * h;
 }
 
 void CF::GetRecommendations(arma::Mat<size_t>& recommendations)
@@ -164,14 +164,6 @@
     mask(data(1, i) - 1, data(0, i) - 1) = -1.0;
 }
 
-void CF::GenerateRating()
-{
-  Log::Info<<"GenerateRatings"<<endl;
-  //Calculating approximate rating
-  rating = w*h;
-  //data::Save("rating.csv",rating);
-}
-
 void CF::Query(arma::Mat<size_t>& recommendations,
                arma::Col<size_t>& users)
 {

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 15:43:00 2013
@@ -196,8 +196,6 @@
   void CalculateApproximateRatings();
   //!Converts the User, Item, Value Matrix to User-Item Table
   void CleanData();
-  //!Create ratings from user and item matrices
-  void GenerateRating();
 
   /**
    * Queries the obtained rating matrix.



More information about the mlpack-svn mailing list