Question: 1 / 50

In R code for plotting a decision tree, which function is used?

plot.tree()

rpart.plot()

The function `rpart.plot()` is used in R for plotting decision trees. This function is part of the `rpart.plot` package, which provides a convenient way to visualize trees created by the `rpart` function, a common method for recursive partitioning for classification and regression. Using `rpart.plot()`, you can create a graphical representation of the decision tree that illustrates the decisions made at each node, the splitting conditions, and the terminal nodes (leaves), making it easier to interpret the model's structure and results. The other options do not exist as standard functions for plotting decision trees directly in R. While there may be similar-sounding functions, they do not correspond to established methods for visualizing decision trees as `rpart.plot()` does. Thus, selecting `rpart.plot()` provides a clear and effective means to visually represent the decision tree created from data.

tree.plot()

visualize.tree()

Next

Report this question