I’m using the TM package to get “responsive documents” from the Enron data set. There are over 800 docs and I built a cart model to sort the docs into responsive and non-responsive. Now, I want to pull up responsive docs and read them, but I can’t (the tm docs were of no help). Does anyone know how to do this? Below is my code:
library(rpart)
library(rpart.plot)
emailCART = rpart(responsive ~ ., data=train, method="class")
# print cart model
prp(emailCART)
# evaluate model on test set
pred = predict(emailCART, newdata=test)
pred[1:10,]
# interested in right-most column predicted
pred.prob = pred[,2]
# I want to access the doc that are true positive.
table(test$responsive, pred.prob >= 0.5)
accuracy = (195+25)/(195+25+20+17)
accuracy
# baseline model predicts only 0
table(test$responsive)
# results say we'd be correct 215 times
base_accuracy = 215/(215+42)