RTextTools on Windows?

671 views
Skip to first unread message

devmag

unread,
Dec 11, 2011, 1:29:29 PM12/11/11
to rtexttools-help
Dear all,

I am using RTextTools package on Windows 7 Professional with R version
2.13.

I managed to create a corpus but I basically can not run any models.

If I run:

models <- train_models(corpus, algorithms=c("GLMNET","MAXENT","SVM"))

The error is:
Error in if (outlist$msg != "Unknown error") return(outlist) :
argument is of length zero

Only running
models <- train_models(corpus, algorithms=c("SVM"))

The error is:

Error in SparseM::t(SparseM::t(x[cret$index[1:cret$nr], ])) :
error in evaluating the argument 'x' in selecting a method for
function 't': Error in SparseM::t(x[cret$index[1:cret$nr], ]) :
error in evaluating the argument 'x' in selecting a method for
function 't': Error in `[.matrix.coo`(x, rw, cl) : Subscripts out of
bound

When running

models <- train_models(corpus, algorithms=c("MAXENT"))

most of the time the RGui just crashes with the following error:

Problem Event Name: APPCRASH
Application Name: Rgui.exe
Application Version: 2.130.55427.0
Application Timestamp: 4da5a51a
Fault Module Name: maxent.dll
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 4ee2cc13
Exception Code: c0000005

Do you know what the problem is here? It seems to be loading all
required packages, though some are build under R 2.13.2 - is this the
reason why it wont work?

Thanks a lot for your help!

Tim Jurka

unread,
Dec 11, 2011, 1:47:12 PM12/11/11
to rtextto...@googlegroups.com
Hello,

Do you think you could show the full code you're running? It looks like something might be wrong with the way the data is partitioned.

Best,
Tim

Brian Abelson

unread,
Mar 2, 2012, 10:12:40 PM3/2/12
to rtextto...@googlegroups.com
I am having the same problem on Mac OSx

here is my code:

 library(RTextTools)

#import data
alltweets <- read.csv("~", header=T)

#separate text elements into a character matrix
#genderdata is a 4x53432 character matrix.
genderdata  <- cbind(as.character(alltweets$text),as.character(alltweets$handle),as.character(alltweets$name),alltweets$gender)

#separate out training and test data
train  <- genderdata[1:142,]
test  <- genderdata[143:52432,]

#create document matrix
train1  <- create_matrix(cbind(train[,1:4]), weighting=weightTfIdf)

#create corpus
corpus  <- create_corpus(train1, train1$gender, trainSize=c(1:50,100:120), testSize=c(51:99,121:142), virgin=FALSE) 

#generate models
maxent_model  <- train_model(corpus, "MAXENT")
svm_model  <- train_model(corpus, "SVM")
Reply all
Reply to author
Forward
0 new messages