0

I tested a new data that is provided from uI, so i used new.csv file which has same column name as trained model.

What is the problem with this?

i get error in this line classify_models(container2,maxent_model)

load("maxent.rda")
new = read_csv("new.csv")
new$data <- paste(new$Title,new$Body)
new$data = as.character(new$data)
new$data = as.character(new$data)
new$data[nrow(new)] = as.character(input$caption)
new$data = toupper(new$data)
new$data = gsub("<.*?>", "", as.character(new$data))
new$data = gsub("&amp", "", new$data)
new$data = gsub("(RT|via)((?:\\b\\W*@\\w+)+)", "", new$data)
new$data = gsub("@\\w+", "", new$data)
new$data = gsub("[[:punct:]]", "", new$data)
new$data = gsub("[[:digit:]]", "", new$data)
new$data = gsub("http\\w+", "", new$data)
new$data = gsub("[ \t]{2,}", "", new$data)
new$data = gsub("^\\s+|\\s+$", "", new$data)
#write.csv(new, "new_data1.csv", row.names = FALSE)
matrix2 <- create_matrix(new["data"], language="english", 
    weighting=tm::weightTfIdf)
container2 <- create_container(matrix2, new$TagId, trainSize=NULL, 
                               testSize=1:nrow(new), virgin=TRUE)
maxent_results2 <- classify_models(container2,maxent_model)
mydata = data.frame(new,maxent_results2)
3
  • I think you should try a trainSize different to NULL. Split the number of rows in train and test for example 80%/20%. Cheers. Commented May 24, 2019 at 10:07
  • i changed trainsize but still it is not working Commented May 24, 2019 at 10:12
  • i am not giving training , i want to test only Commented May 24, 2019 at 10:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.