Error:no applicable method for 'QuinlanAttributes' applied to an object of class "logical"

r
decision_trees

#1

I am currently working on classification problem and I am doing classification using C5.0 decision tree and while creating the model I am getting the error
model<-C5.0(train[,-1934],train$target)
Error in UseMethod(“QuinlanAttributes”) :
no applicable method for ‘QuinlanAttributes’ applied to an object of class "logical"
target is logical vector and also the output variable.


#2

see the documentation

C5.0(x, …)

Default S3 method:

C5.0(x, y, trials = 1, rules= FALSE,
weights = NULL,
control = C5.0Control(),
costs = NULL, …)

S3 method for class ‘formula’

C5.0(formula, data, weights, subset,
na.action = na.pass, …)

you will see how to pass the parameters correctly


#3

@ajay_ohriv Please can you clarify your answer? I am getting a similar error and I think I passed the parameters correctly. Here’s my error message:

Error in UseMethod(“QuinlanAttributes”) :
no applicable method for ‘QuinlanAttributes’ applied to an object of class “impute”

Thanks.