I am trying to Classify text using RTextTools
package using R.
I have done this using - SVM
(and the below code works fine :)
matrix[[i]] <- create_matrix(trainingdata[[i]][,1], language="english",removeNumbers=FALSE, stemWords=FALSE,weighting=weightTf,minWordLength=3)
container[[i]] <- create_container(matrix[[i]],trainingdata[[i]][,2],trainSize=1:length(trainingdata[[i]][,1]),virgin=FALSE)
models[[i]] <- train_models(container[[i]], algorithms=c("SVM"))
But when i do the same thing with MAXENT
algorithm
models[[i]] <- train_models(container[[i]], algorithms=c("MAXENT"))
It throws me error:
Error in Module(module, mustStart = TRUE) :
function 'setCurrentScope' not provided by package 'Rcpp'
When i did traceback - got the below details
Module(module, mustStart = TRUE)
.getModulePointer(x)
maximumentropy$add_samples
maximumentropy$add_samples
train_maxent(feature_matrix, code_vector, l1_regularizer, l2_regularizer,
maxent(container@training_matrix, as.vector(container@training_codes),
train_model(container, algorithm, ...)
train_models(container[[i]], algorithms = c("MAXENT"))
update:
sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_Singapore.1252 LC_CTYPE=English_Singapore.1252 LC_MONETARY=English_Singapore.1252
[4] LC_NUMERIC=C LC_TIME=English_Singapore.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] tm_0.5-10 hash_3.0.1 RTextTools_1.4.2 SparseM_1.03
loaded via a namespace (and not attached):
[1] bitops_1.0-6 caTools_1.16 class_7.3-9 e1071_1.6-1 glmnet_1.9-5 grid_3.0.2
[7] ipred_0.9-3 KernSmooth_2.23-10 lattice_0.20-23 lava_1.2.4 MASS_7.3-29 Matrix_1.1-2
[13] maxent_1.3.3.1 nnet_7.3-7 parallel_3.0.2 prodlim_1.4.2 randomForest_4.6-7 Rcpp_0.10.6
[19] rpart_4.1-5 slam_0.1-31 splines_3.0.2 survival_2.37-7 tau_0.0-16 tools_3.0.2
[25] tree_1.0-34
Is there a way to solve this problem.