1

我已经使用rpartR 中的包构建了几个回归树模型,我需要将它们迁移到另一种语言,例如 Perl。

predict 函数在 R 中运行良好,但是有没有办法在每个节点上打印出加权公式之类的东西?

4

1 回答 1

1

I believe what you are trying to do can be done using a little hack of the Rattle package/GUI. If you install Rattle then from the command line use the asRules() function on your rpart fit object and you will get back a human readable rules set. I have used these rules to quickly convert to SQL or other languages in seconds. I hope this helps.

于 2012-10-13T11:48:45.747 回答