i

R Programming Complete Tutorial

Decision Trees

A decision tree is a decision support mechanism that utilizes a tree-like decision graph or model and its possible consequences, including outcomes of chance events, resource costs, and utility. It is one way of displaying an algorithm that contains statements of conditional control only.

A decision tree is a flowchart-like framework where each internal node represents an attribute "test" , each branch represents the test result, and each leaf node represents a class label. The paths from the root to the leaf represent classification rules.

Tree-based learning algorithms are considered to be one of the best and mostly used supervised learning methods. Tree-based methods empower predictive models with high stability, accuracy, and ease of interpretation. Unlike linear models, they map non-linear relationships quite well. We can solve any kind of classification and Regression problems using it.

Decision Tree Syntax:

Example:

In this section, we will step by step go through a complete Decision Tree using the iris dataset.

Decision Tree: plot(dtree_iris)