2016-04-16 17 views
1

我想比較一些推薦算法對彼此,但我遇到了一些內存問題。我使用的數據集是https://drive.google.com/open?id=0By5yrncwiz_VZUpiak5Hc2l3dkERecommenderlab運行到內存問題

以下是我的代碼:

library(recommenderlab) 
library(Matrix) 

Amazon <- read.csv(Path to Reviews.csv, header = TRUE, 
       col.names = c("ID","ProductId","UserId","HelpfulnessNumerator","HelpfulnessDenominator","Score", 
          "Time","Summary","Text"), 
       colClasses = c("NULL","character","character","NULL","NULL","integer","NULL","NULL","NULL")) 

Amazon <- Amazon[,c("UserId","ProductId","Score")] 

Amazon <- Amazon[!duplicated(Amazon[1:2]),] ## To get unique values 

scheme <- evaluationScheme(r, method = "split", train = .7, 
         k = 1, given = 1 ,goodRating = 4) 

algorithms <- list(
"user-based CF" = list(name="UBCF", param=list(normalize = "Z-score", 
              method="Cosine", 
              nn=50, minRating=3)), 
"item-based CF" = list(name="IBCF", param=list(normalize = "Z-score" 
)) 

) 

results <- evaluate(scheme, algorithms, n=c(1, 3, 5)) 

我收到以下錯誤:

UBCF run fold/sample [model time/prediction time] 
1 Timing stopped at: 1.88 0 1.87 
Error in asMethod(object) : 
Cholmod error 'problem too large' at file ../Core/cholmod_dense.c, line 105 
IBCF run fold/sample [model time/prediction time] 
1 Timing stopped at: 4.93 0.02 4.95 
Error in asMethod(object) : 
Cholmod error 'problem too large' at file ../Core/cholmod_dense.c, line 105 
Warning message: 
In .local(x, method, ...) : 
Recommender 'user-based CF' has failed and has been removed from the results! 
Recommender 'item-based CF' has failed and has been removed from the results! 

我試圖用recommenderlabrats包,我認爲會解決這個問題但無法安裝它。 https://github.com/sanealytics/recommenderlabrats

這給了我一些錯誤,這些錯誤我不打包做的意義:

C:/rbuildtools/3.3/gcc-4.6.3/bin /../ LIB/GCC/i686的-w64- mingw32/4.6.3 /../../../../ i686-w64-mingw32/bin/ld.exe:找不到-llapack collect2:ld返回1退出狀態

然後我來了此鏈接解決推薦的版本問題,但它不適用於我 Error while installing package from github in R. Error in dyn.load

有關如何解決內存問題的任何幫助,讚賞

回答

0

我是推薦作者。嘗試現在安裝,它應該被修復。然後使用RSVD/ALS來解決。即使您的電腦稀少,您的矩陣也太大了。

另外,在AWS內存實例上花費之前嘗試更小的樣本可能是個好主意。