【发布时间】:2016-09-13 17:01:34
【问题描述】:
我正在使用 R.3.2.1 上的 maxent R 包对 1,000,000 条推文进行监督分类和训练,其中 25% 用于测试。其中Tweet 是预测变量,City 是标签。 Linux 内核在 Centos 集群平台上运行,每个内核至少有 128GB RAM。内存不是问题。
这是我的 R 代码:
library(maxent)
file <- read.csv("JoinedTable.csv")
data <- file[sample(1:3700000,size=1000000,replace=FALSE),]
matrix <- create_matrix(data$Tweet, language="english", stripWhitespace = TRUE, toLower = TRUE, stemWords=FALSE, removePunctuation = TRUE, removeStopwords=TRUE, removeNumbers=TRUE, removeSparseTerms=.998)
sparse2 <- as.compressed.matrix(matrix)
model <- maxent(sparse2[1:750000,],as.factor(data$CIty)[1:750000])
results <- predict(model,sparse2[750001:1000000,])
这是返回的错误消息:
*** caught segfault ***
address (nil), cause 'memory not mapped'
Traceback:
1: .External(list(name = "InternalFunction_invoke", address = <pointer: 0x2a3d5750>, dll = list(name = "Rcpp", path = "/users/40113951/gridware/share/R/3.2.1/Rcpp/libs/Rcpp.so", dynamicLookup = TRUE, handle = <pointer: 0x451c3e90>, info = <pointer: 0x7fe0c5ecb940>), numParameters = -1L), <pointer: 0x42b1aea0>, ...)
2: maximumentropy$classify_samples(as.integer(feature_matrix@dimension[1]), as.integer(feature_matrix@dimension[2]), feature_matrix@ia, ja, feature_matrix@ra, model)
3: classify_maxent(feature_matrix, object@model)
4: predict.maxent(model, sparse2[750001:1e+06, ])
5: predict(model, sparse2[750001:1e+06, ])
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
【问题讨论】:
-
通知包的作者并尝试在较小的数据集上重现错误。它看起来像一个错误,不要认为除了作者之外的任何人都可以在这里提供帮助。
标签: r classification text-mining