golf.txt
(473 Bytes)
然后我用 R 语言做分析,代码如下:
- golf <- read.csv("golf.txt", header = TRUE, sep = ",")
- varNum <- ncol(golf) - 1
- colnames(golf)[varNum + 1] <- "target"
- library(C50)
- golftree <- C5.0(target ~ . ,data = golf)
- summary(golftree)
但是用 plot 函数画图时,会报错,代码如下
- plot(golftree)
错误信息如下:
- Error in partysplit(varid = as.integer(i), index = index, info = k, prob = NULL) :
- minimum of ‘index’ is not equal to 1
- In addition: Warning message:
- In min(index, na.rm = TRUE) :
- no non-missing arguments to min; returning Inf
请问为什么画不出来决策树呢? 我预期的结果类似于下图
请问如何画出这个例子的决策树呢?


雷达卡




京公网安备 11010802022788号







