“Error in sort.list(y) : 'x' must be atomic for 'sort.list'

r
classification

#1

I am doing one classification problem in R but after the predication model I want to get the table between predicted one and tested one but I am getting the error
“Error in sort.list(y) : ‘x’ must be atomic for 'sort.list’
Have you called ‘sort’ on a list?
library(C50)
train<-read.csv(“data.csv”)
test<-read.csv(“result.csv”)
m1 <- C5.0(train[,-15],test[,15])#model
p1 <- predict(m1,test)#predicator
summary(p1)
table(test,p1)


#2

Can you show what is the head of the matrix p1? And where do you get this error?


#3

library(C50)
train<-read.csv(“data.csv”)
test<-read.csv(“result.csv”)

m1 <- C5.0(train[,-15],test[,15])#model

p1 <- predict(m1,test)#predicator

summary(p1)
table(test,p1)

I am getting this error after table command


#4

Can you supply the str(test) and str(p1)?


#5

I am facing exactly the same issue: I am building a logistic model in R and have also converted my variables to PCA.
It throws the same error when I run my table syntax for my predicted train model.

Did you find a solution to your problem? If so can u please tell me how you went about with it?