我需要你的帮助,因为我不明白为什么我的 RStudio 终结器/在对文本分类执行最大熵时停止工作。我使用推文数据 7877 行。有代码
library(tm)
library(RTextTools)
library(e1071)
library(caret)
library(ROCR)
cdr<- getwd()
setwd("E:/KULIAH")
text<- read.csv("klasifikasi tweet.csv")
set.seed(95616)
index<- sample(2, dim(text)[1], replace = T, prob = c(0.8,0.2))
text = rbind(text[index==1,], text[index==2,])
input <- text$tweet
class <- as.factor(text$kelas.)
text_mat<-create_matrix(input,language = "english", removeNumbers = TRUE,removePunctuation = F, removeStopwords =F,removeSparseTerms=0.998, stemWords = F, weighting = weightTfIdf)
train_data<- create_container(text_mat, as.numeric(class), trainSize=1:4000, testSize=4001:4449, virgin = FALSE)
model<-train_model(train_data, "MAXENT")
result<- classify_model(train_data, model)
感谢帮助截图