Data Science Desktop Survival Guide
by Graham Williams |
|||||
C5.0 Rules 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="class")
sum(ds[te, target] != predicted)/length(predicted) # Overall error rate ## Warning: Incompatible methods ("Ops.data.frame", "Ops.factor") for "!=" ## Error in ds[te, target] != predicted: comparison of these types is not implemented
round(100*table(ds[te, target], predicted, dnn=c("Actual", "Predicted"))/length(predicted))
## Warning in Ops.factor(xi, xj): '>' not meaningful for factors ## Error in if (xi > xj) 1L else -1L: missing value where TRUE/FALSE needed
|