Open guozhizou opened 8 years ago
Hello, I am getting the same error. Any help will be deeply appreciated. @beechung Thanks.
I think the problem is because after R 3.x, R no long supports DUP=FALSE. The solution is to change from .C(...) to .Call(...) for the C code in src/LDA-RLFM/C/, in a way similar to the following commit.
https://github.com/beechung/Latent-Factor-Models/commit/1c3e0f50ec9dbb8cd84c30c91799d224eb893b01
When I use R 3.x, I have also encountered a lot of problems。 And I used R 2.x, those problems disappered
This solved the problem. Thanks a lot @beechung and @narutolhy .
There is another issue. In examples.R, line 267: library(arm) is generating an error- Error in library(arm) : there is no package called ‘arm’ I have placed the arms.c and arms.h files in arslogistic and yet face this problem. @narutolhy
To install a R package, use the following command: install.packages("arm")
You need to first install it before you can use it.
@beechung I used R 2.15.3 instead of R 3.x and that solved the initial problem and the subsequent problems that were present despite changing .C(...) to .Call(...). The current problem is that "arm" package is not available for R 2.15.3. Can you suggest a work around? Also I want to implement fLDA for my own dataset but I could not find reIndexData and indexTestData as mentioned in prediction.R or any explanation about the dataset used in this code.
Running src/LDA-RLFM/R/model/examples.R, I got following exception:
WARNING: Some terms do not belong to any items in the corpus.
* caught segfault * address 0x0, cause 'unknown'
Traceback: 1: .C("fillInTopicCounts", output$cnt_item_topic, output$cnt_topic_term, output$cnt_topic, output$z_avg, corpus_topic, corpus$item, corpus$term, corpus$weight, as.integer(nItems), as.integer(nrow(corpus)), as.integer(nTopics), as.integer(nTerms), as.integer(nCorpusWeights), as.integer(debug), DUP = FALSE) 2: getTopicCounts(corpus, factor$corpus_topic, nItems, nTopics, size$nTerms) 3: fit.MCEM(nIter = 5, nSamples = 100, nBurnIn = 10, factor = data.train$factor, obs = data.train$obs, feature = data.train$feature, param = data.train$param, corpus = data.train$corpus, try = list(lambda = c(0.5, 1, 2, 4, 8), eta = c(0.5, 1, 2, 4)), out.level = 1, out.dir = "/tmp/test/lda-rlfm", out.append = FALSE, debug = 1, verbose = 1, verbose.M = 1, use.C = TRUE, lm = T) An irrecoverable exception occurred. R is aborting now ...
Thanks for any help!