Building a classification model with recursive partitioning trees
In the previous recipe, we introduced how to use logistic regression to build a classification model. We now cover how to use a recursive partitioning tree to predict customer behavior. A classification tree uses split condition to predict class labels based on one or multiple input variables. The classification process starts from the root node of the tree; at each node, the process will check whether the input value should recursively continue to the right or left sub-branch according to the split condition, and stops when meeting any leaf (terminal) nodes of the decision tree. In this recipe, we introduce how to apply a recursive partitioning tree on the shopping cart dataset. ...
Get R for Data Science Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.