R 插入符号使用C5.0方法,如何绘制最终的树

R 插入符号使用C5.0方法,如何绘制最终的树,r,plot,r-caret,boosting,R,Plot,R Caret,Boosting,我使用的是train package方法=C5.0,希望看到最终模型绘制为树。 生成的树已定义为: The final values used for the model were trials = 15, model = tree and winnow = FALSE. 当我尝试使用plot或Crattle的fancyRplotModel绘制树时,我得到以下错误: 使用绘图: plot(diabetes.c50$finalModel,trials=15) Error in plot(diab

我使用的是train package方法=C5.0,希望看到最终模型绘制为树。 生成的树已定义为:

The final values used for the model were trials = 15, model = tree and winnow = FALSE.
当我尝试使用plot或Crattle的fancyRplotModel绘制树时,我得到以下错误:

使用绘图:

plot(diabetes.c50$finalModel,trials=15)
Error in plot(diabetes.c50$finalModel, trials = 15) : 
  object 'diabetes.c50' not found
使用拨浪鼓:

fancyRpartPlot(diabetes.C50$finalModel,trials=15)
Error in if (model$method == "class") { : argument is of length zero
最终模型已定义为:

> diabetes.C50$finalModel

Call:
C5.0.default(x = structure(c(6, 8, 0, 8, 4, 10, 10, 1, 5, 7, 1, 1, 3, 8, 7, 9, 11, 10, 7, 1, 13, 5, 5, 3, 6, 4, 11, 9, 4, 3, 9, 7, 0,
 "outcome", seed = 2187L), .Names = c("subset", "bands", "winnow", "noGlobalPruning", "CF", "minCases", "fuzzyThreshold",
 "sample", "earlyStopping", "label", "seed")), verbose = FALSE)

Classification Tree
Number of samples: 538 
Number of predictors: 8 

Number of boosting iterations: 15 
Average tree size: 12.9 

Non-standard options: attempt to group attributes

表示C5.0树的数据结构与表示rpart树的数据结构不同。Crattle的fancyRpartPlot()假设一个rpart树,因此您会得到一个错误(最新版本的Crattle检查模型类并解释此错误,而不是使用上述无法识别的消息失败)

您的第一个错误看起来像一个打字错误,错误信息是不言自明的。你指的是糖尿病。C50美元最终模型而不是糖尿病。c50美元最终模型(大写c50而不是小写c50)。

这有帮助吗?