Data Science Desktop Survival Guide
by Graham Williams |
|||||
Conditional Decision Tree Performance |
Here we plot the performance of the decision tree, showing a risk chart. The areas under the recall and risk curves are also reported.
predicted <- predict(model, ds[te, vars], type="prob")[,2]
riskchart(predicted, actual, risks) ## Error in na.omit(ac): object 'actual' not found
An error matrix shows, clockwise from the top left, the percentages of true negatives, false positives, true positives, and false negatives.
|
predicted <- predict(model, ds[te, vars], type="response")
sum(actual != predicted)/length(predicted) # Overall error rate ## Error in eval(expr, envir, enclos): object 'actual' not found
round(100*table(actual, predicted, dnn=c("Actual", "Predicted"))/length(predicted))
## Error in table(actual, predicted, dnn = c("Actual", "Predicted")): object 'actual' not found
|