Question

I've built several regression tree models using the rpart package in R and I need to migrate them into another language such as Perl.

The predict function works fine within R, but is there a way to print out something like the weighted formula at each node?

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top