0

Here, I am predicting the type of glass based on its chemical content.chemical contents are input which are of numeric type(Ri,Na etc) and type of glass is output(Typec) which is factor.After building model using C5.0 I am getting error like

"Error: Tree models only"

This is my code:

train=datax[sample(nrow(datax),80,replace=F),]

test=datax[!(1:nrow(datax))%in%as.numeric(row.names(train)),]

model=C5.0(Typec~.,data=train,rules=T, ntree= 50)

plot(model) 

Here after running the plot instruction Im getting error mentioned.

1 Answers1

0
model=C5.0(Typec~.,data=train,rules=T, ntree= 50)

Remove "rules = T" argument and then you'll be able to plot the graph

Paul Roub
  • 36,322
  • 27
  • 84
  • 93