dimanche 5 avril 2015

Getting back original names from rpart.object


Vote count:

0




I have saved models which were created using the rpart package in R. I am trying to retrieve some information from these saved models; specifically from rpart.object. While the documentation - rpart doc - is helpful there are a few things it is not clear about:



  1. How do I find out which variables are categorical and which are numeric? Currently, what I do is refer to the 'index' column in the splits matrix. I've noticed that for numeric variables only, the entry is not an integer. Is there a cleaner way to do this?

  2. The csplit matrix refers to the various values a categorical variable can take using integers i.e. R maps the original names to integers. Is there a way to access this mapping?



asked 39 secs ago







Getting back original names from rpart.object

Aucun commentaire:

Enregistrer un commentaire