我正在使用R上的"iris“数据进行决策树分析。现在的问题是,就使用print和plots获得输出而言,一切都很好,但是当我尝试使用ctree生成PMML文件时,我遇到了以下错误:
Error in UseMethod("pmml") :
no applicable method for 'pmml' applied to an object of class "c('BinaryTree', 'BinaryTreePartition')"使用rpart库,虽然我能够成功地生成PMML,但我无法弄清楚为什么不使用ctree生成pmml。我把工作和非工作的结果都放在
Not-working:
============
library("party")
iris_ctree <- ctree(Species ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width, data=iris)
pmml(iris_ctree)
[ I am getting error over here , which i mentioned above ]
Working:
========
library("rpart")
iris_tree <- rpart(Species ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width, data=iris)
pmml(iris_tree)
[ I am getting a PMML output over here]我在windows(64位)-version 3.0.2上使用R。
如果有人知道为什么会发生这种事,我会提前表示感谢。
发布于 2013-11-23 09:47:34
pmml包目前不支持从party导出ctree对象。我不知道有什么立即这样做的计划或替代方案,但可能只需要几个小时就能让一个好的R编码器实现它(然后将它添加到pmml包中:-)。
https://stackoverflow.com/questions/20087970
复制相似问题