我正在使用 train 包 method=C5.0 并希望看到 finalModel 绘制为一棵树。结果树已定义:
The final values used for the model were trials = 15, model = tree and winnow = FALSE.
当我尝试使用 plot 或拨浪鼓的 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
finalModel 已定义:
> 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