So I got my training set with 70% of my data called "train" / 30% "test"
I use ctree
to get my decision tree model with something like this code below :
model_ctree <- ctree(response ~ x1 + .. xn , data = train)
How can I apply this model to "test" and evaluate the model, use something like lift or gain chart or ROC; something that I would normally get from SAS miner?
I am new to R
.
Best Answer
Try this for class predictions:
Try this for class probabilities:
Try this for a roc curve:
Try this for a lift curve:
Sensitivity/specificity curve and precision/recall curve:
More info:
Also, you should check out the
caret
package if you're building predictive models in R. It implements a number of out-of-sample evaluation schemes, including bootstrap sampling, cross-validation, and multiple train/test splits.caret
is really nice because it provides a unified interface to all the models, so you don't have to remember, e.g., thattreeresponse
is the function to get class probabilities from a ctree model. Here's an example of using 10-fold cross-validation to evaluation your model, which is much better than a single train/test split: