在 R 语言中使用 C5.0 构建决策树时出错



在这里,我根据其化学成分预测玻璃的类型.化学成分是数字类型(Ri,Na等(的输入,玻璃类型是输出(Typec(,这是因素。使用 C5.0 构建模型后,出现错误 喜欢

"错误:仅限树模型">

这是我的代码:

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) 

在这里,在运行绘图指令后,我收到了提到的错误。

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

删除"rules = T"参数,然后您就可以绘制图形

最新更新