我正在尝试比较一些推荐算法,但遇到了一些内存问题。我使用的数据集是https://drive.google.com/open?id=0By5yrncwiz_VZUpiak5Hc2l3dkE
以下是我的代码:
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!我试着使用我认为可以解决这个问题的推荐软件包,但是无法安装它。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
任何有关如何解决内存问题的帮助都将不胜感激
发布于 2016-07-22 12:56:56
我是推荐实验室的作者。尝试现在安装,它应该会被修复。然后利用RSVD/ALS进行求解。你的矩阵太大了,即使它对于你的计算机来说是稀疏的。
此外,在AWS内存实例上花费之前尝试较小的样本也可能是一个好主意。
https://stackoverflow.com/questions/36666241
复制相似问题