Tree-based Models
   HOME

TheInfoList



OR:

Decision tree learning is a
supervised learning In machine learning, supervised learning (SL) is a paradigm where a Statistical model, model is trained using input objects (e.g. a vector of predictor variables) and desired output values (also known as a ''supervisory signal''), which are often ...
approach used in
statistics Statistics (from German language, German: ', "description of a State (polity), state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data. In applying statistics to a s ...
,
data mining Data mining is the process of extracting and finding patterns in massive data sets involving methods at the intersection of machine learning, statistics, and database systems. Data mining is an interdisciplinary subfield of computer science and ...
and
machine learning Machine learning (ML) is a field of study in artificial intelligence concerned with the development and study of Computational statistics, statistical algorithms that can learn from data and generalise to unseen data, and thus perform Task ( ...
. In this formalism, a classification or regression
decision tree A decision tree is a decision support system, decision support recursive partitioning structure that uses a Tree (graph theory), tree-like Causal model, model of decisions and their possible consequences, including probability, chance event ou ...
is used as a predictive model to draw conclusions about a set of observations. Tree models where the target variable can take a discrete set of values are called
classification Classification is the activity of assigning objects to some pre-existing classes or categories. This is distinct from the task of establishing the classes themselves (for example through cluster analysis). Examples include diagnostic tests, identif ...
trees In botany, a tree is a perennial plant with an elongated stem, or trunk, usually supporting branches and leaves. In some usages, the definition of a tree may be narrower, e.g., including only woody plants with secondary growth, only p ...
; in these tree structures,
leaves A leaf (: leaves) is a principal appendage of the stem of a vascular plant, usually borne laterally above ground and specialized for photosynthesis. Leaves are collectively called foliage, as in "autumn foliage", while the leaves, stem, ...
represent class labels and branches represent conjunctions of features that lead to those class labels. Decision trees where the target variable can take continuous values (typically
real numbers In mathematics, a real number is a number that can be used to measurement, measure a continuous variable, continuous one-dimensional quantity such as a time, duration or temperature. Here, ''continuous'' means that pairs of values can have arbi ...
) are called regression
trees In botany, a tree is a perennial plant with an elongated stem, or trunk, usually supporting branches and leaves. In some usages, the definition of a tree may be narrower, e.g., including only woody plants with secondary growth, only p ...
. More generally, the concept of regression tree can be extended to any kind of object equipped with pairwise dissimilarities such as categorical sequences. Decision trees are among the most popular machine learning algorithms given their intelligibility and simplicity because they produce algorithms that are easy to interpret and visualize, even for users without a statistical background. In decision analysis, a decision tree can be used to visually and explicitly represent decisions and
decision making In psychology, decision-making (also spelled decision making and decisionmaking) is regarded as the cognitive process resulting in the selection of a belief or a course of action among several possible alternative options. It could be either ra ...
. In
data mining Data mining is the process of extracting and finding patterns in massive data sets involving methods at the intersection of machine learning, statistics, and database systems. Data mining is an interdisciplinary subfield of computer science and ...
, a decision tree describes data (but the resulting classification tree can be an input for decision making).


General

Decision tree learning is a method commonly used in data mining. The goal is to create an algorithm that predicts the value of a target variable based on several input variables. A decision tree is a simple representation for classifying examples. For this section, assume that all of the input
feature Feature may refer to: Computing * Feature recognition, could be a hole, pocket, or notch * Feature (computer vision), could be an edge, corner or blob * Feature (machine learning), in statistics: individual measurable properties of the phenome ...
s have finite discrete domains, and there is a single target feature called the "classification". Each element of the domain of the classification is called a ''class''. A decision tree or a classification tree is a tree in which each internal (non-leaf) node is labeled with an input feature. The arcs coming from a node labeled with an input feature are labeled with each of the possible values of the target feature or the arc leads to a subordinate decision node on a different input feature. Each leaf of the tree is labeled with a class or a probability distribution over the classes, signifying that the data set has been classified by the tree into either a specific class, or into a particular probability distribution (which, if the decision tree is well-constructed, is skewed towards certain subsets of classes). A tree is built by splitting the source
set Set, The Set, SET or SETS may refer to: Science, technology, and mathematics Mathematics *Set (mathematics), a collection of elements *Category of sets, the category whose objects and morphisms are sets and total functions, respectively Electro ...
, constituting the root node of the tree, into subsets—which constitute the successor children. The splitting is based on a set of splitting rules based on classification features. This process is repeated on each derived subset in a recursive manner called
recursive partitioning Recursive partitioning is a statistics, statistical method for multivariable analysis. Recursive partitioning creates a Decision tree learning, decision tree that strives to correctly classify members of the population by splitting it into sub-popu ...
. The
recursion Recursion occurs when the definition of a concept or process depends on a simpler or previous version of itself. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in m ...
is completed when the subset at a node has all the same values of the target variable, or when splitting no longer adds value to the predictions. This process of ''top-down induction of decision trees'' (TDIDT) is an example of a
greedy algorithm A greedy algorithm is any algorithm that follows the problem-solving heuristic of making the locally optimal choice at each stage. In many problems, a greedy strategy does not produce an optimal solution, but a greedy heuristic can yield locally ...
, and it is by far the most common strategy for learning decision trees from data. In
data mining Data mining is the process of extracting and finding patterns in massive data sets involving methods at the intersection of machine learning, statistics, and database systems. Data mining is an interdisciplinary subfield of computer science and ...
, decision trees can be described also as the combination of mathematical and computational techniques to aid the description, categorization and generalization of a given set of data. Data comes in records of the form: :(\textbf,Y) = (x_1, x_2, x_3, ..., x_k, Y) The dependent variable, Y, is the target variable that we are trying to understand, classify or generalize. The vector \textbf is composed of the features, x_1, x_2, x_3 etc., that are used for that task.


Decision tree types

Decision trees used in
data mining Data mining is the process of extracting and finding patterns in massive data sets involving methods at the intersection of machine learning, statistics, and database systems. Data mining is an interdisciplinary subfield of computer science and ...
are of two main types: *
Classification tree Classification chart or classification tree is a synopsis of the classification scheme, designed to illustrate the structure of any particular field. Overview Classification is the process in which ideas and objects are recognized, differentia ...
analysis is when the predicted outcome is the class (discrete) to which the data belongs. * Regression tree analysis is when the predicted outcome can be considered a real number (e.g. the price of a house, or a patient's length of stay in a hospital). The term classification and regression tree (CART) analysis is an
umbrella term Hypernymy and hyponymy are the wikt:Wiktionary:Semantic relations, semantic relations between a generic term (''hypernym'') and a more specific term (''hyponym''). The hypernym is also called a ''supertype'', ''umbrella term'', or ''blanket term ...
used to refer to either of the above procedures, first introduced by Breiman et al. in 1984. Trees used for regression and trees used for classification have some similarities – but also some differences, such as the procedure used to determine where to split. Some techniques, often called ''ensemble'' methods, construct more than one decision tree: * Boosted trees Incrementally building an ensemble by training each new instance to emphasize the training instances previously mis-modeled. A typical example is
AdaBoost AdaBoost (short for Adaptive Boosting) is a statistical classification meta-algorithm formulated by Yoav Freund and Robert Schapire in 1995, who won the 2003 Gödel Prize for their work. It can be used in conjunction with many types of learnin ...
. These can be used for regression-type and classification-type problems. * Committees of decision trees (also called k-DT), an early method that used randomized decision tree algorithms to generate multiple different trees from the training data, and then combine them using majority voting to generate output. * Bootstrap aggregated (or bagged) decision trees, an early ensemble method, builds multiple decision trees by repeatedly resampling training data with replacement, and voting the trees for a consensus prediction. ** A
random forest Random forests or random decision forests is an ensemble learning method for statistical classification, classification, regression analysis, regression and other tasks that works by creating a multitude of decision tree learning, decision trees ...
classifier is a specific type of
bootstrap aggregating Bootstrap aggregating, also called bagging (from bootstrap aggregating) or bootstrapping, is a machine learning (ML) ensemble meta-algorithm designed to improve the stability and accuracy of ML classification and regression algorithms. It also ...
* Rotation forest – in which every decision tree is trained by first applying
principal component analysis Principal component analysis (PCA) is a linear dimensionality reduction technique with applications in exploratory data analysis, visualization and data preprocessing. The data is linearly transformed onto a new coordinate system such that th ...
(PCA) on a random subset of the input features. A special case of a decision tree is a
decision list Decision lists are a representation for Boolean functions which can be easily learnable from examples. Single term decision lists are more expressive than disjunctions and conjunctions; however, 1-term decision lists are less expressive than the ...
, which is a one-sided decision tree, so that every internal node has exactly 1 leaf node and exactly 1 internal node as a child (except for the bottommost node, whose only child is a single leaf node). While less expressive, decision lists are arguably easier to understand than general decision trees due to their added sparsity, permit non-greedy learning methods and monotonic constraints to be imposed. Notable decision tree algorithms include: *
ID3 ID3 is a metadata container most often used in conjunction with the MP3 audio file format. It allows information such as the title, artist, album, track number, and other information about the file to be stored in the file itself. ID3 is a '' ...
(Iterative Dichotomiser 3) * C4.5 (successor of ID3) * CART (Classification And Regression Tree) * OC1 (Oblique classifier 1). First method that created multivariate splits at each node. * Chi-square automatic interaction detection (CHAID). Performs multi-level splits when computing classification trees. *
MARS Mars is the fourth planet from the Sun. It is also known as the "Red Planet", because of its orange-red appearance. Mars is a desert-like rocky planet with a tenuous carbon dioxide () atmosphere. At the average surface level the atmosph ...
: extends decision trees to handle numerical data better. * Conditional Inference Trees. Statistics-based approach that uses non-parametric tests as splitting criteria, corrected for multiple testing to avoid overfitting. This approach results in unbiased predictor selection and does not require pruning. ID3 and CART were invented independently at around the same time (between 1970 and 1980), yet follow a similar approach for learning a decision tree from training tuples. It has also been proposed to leverage concepts of
fuzzy set theory Fuzzy or Fuzzies may refer to: Music * Fuzzy (band), a 1990s Boston indie pop band * Fuzzy (composer), Danish composer Jens Vilhelm Pedersen (born 1939) * ''Fuzzy'' (album), 1993 debut album of American rock band Grant Lee Buffalo * "Fuzzy", a ...
for the definition of a special version of decision tree, known as Fuzzy Decision Tree (FDT). In this type of fuzzy classification, generally, an input vector \textbf is associated with multiple classes, each with a different confidence value. Boosted ensembles of FDTs have been recently investigated as well, and they have shown performances comparable to those of other very efficient fuzzy classifiers.


Metrics

Algorithms for constructing decision trees usually work top-down, by choosing a variable at each step that best splits the set of items. Different algorithms use different metrics for measuring "best". These generally measure the homogeneity of the target variable within the subsets. Some examples are given below. These metrics are applied to each candidate subset, and the resulting values are combined (e.g., averaged) to provide a measure of the quality of the split. Depending on the underlying metric, the performance of various heuristic algorithms for decision tree learning may vary significantly.


Estimate of Positive Correctness

A simple and effective metric can be used to identify the degree to which true positives outweigh false positives (see
Confusion matrix In the field of machine learning and specifically the problem of statistical classification, a confusion matrix, also known as error matrix, is a specific table layout that allows visualization of the performance of an algorithm, typically a super ...
). This metric, "Estimate of Positive Correctness" is defined below: E_P = TP - FP In this equation, the total false positives (FP) are subtracted from the total true positives (TP). The resulting number gives an estimate on how many positive examples the feature could correctly identify within the data, with higher numbers meaning that the feature could correctly classify more positive samples. Below is an example of how to use the metric when the full confusion matrix of a certain feature is given: Feature A Confusion Matrix Here we can see that the TP value would be 8 and the FP value would be 2 (the underlined numbers in the table). When we plug these numbers in the equation we are able to calculate the estimate: E_p = TP - FP = 8 - 2 = 6. This means that using the estimate on this feature would have it receive a score of 6. However, it should be worth noting that this number is only an estimate. For example, if two features both had a FP value of 2 while one of the features had a higher TP value, that feature would be ranked higher than the other because the resulting estimate when using the equation would give a higher value. This could lead to some inaccuracies when using the metric if some features have more positive samples than others. To combat this, one could use a more powerful metric known as Sensitivity that takes into account the proportions of the values from the confusion matrix to give the actual
true positive rate In medicine and statistics, sensitivity and specificity mathematically describe the accuracy of a test that reports the presence or absence of a medical condition. If individuals who have the condition are considered "positive" and those who do ...
(TPR). The difference between these metrics is shown in the example below: In this example, Feature A had an estimate of 6 and a TPR of approximately 0.73 while Feature B had an estimate of 4 and a TPR of 0.75. This shows that although the positive estimate for some feature may be higher, the more accurate TPR value for that feature may be lower when compared to other features that have a lower positive estimate. Depending on the situation and knowledge of the data and decision trees, one may opt to use the positive estimate for a quick and easy solution to their problem. On the other hand, a more experienced user would most likely prefer to use the TPR value to rank the features because it takes into account the proportions of the data and all the samples that should have been classified as positive.


Gini impurity

Gini impurity, Gini's diversity index, or Gini-Simpson Index in biodiversity research, is named after Italian mathematician Corrado Gini and used by the CART (classification and regression tree) algorithm for classification trees. Gini impurity measures how often a randomly chosen element of a set would be incorrectly labeled if it were labeled randomly and independently according to the distribution of labels in the set. It reaches its minimum (zero) when all cases in the node fall into a single target category. For a set of items with J classes and relative frequencies p_i, i \in \, the probability of choosing an item with label i is p_i, and the probability of miscategorizing that item is \sum_ p_k = 1-p_i. The Gini impurity is computed by summing pairwise products of these probabilities for each class label: :\operatorname_G(p) = \sum_^J \left( p_i \sum_ p_k \right) = \sum_^J p_i (1-p_i) = \sum_^J (p_i - p_i^2) = \sum_^J p_i - \sum_^J p_i^2 = 1 - \sum^J_ p_i^2. The Gini impurity is also an information theoretic measure and corresponds to Tsallis Entropy with deformation coefficient q=2, which in physics is associated with the lack of information in out-of-equilibrium, non-extensive, dissipative and quantum systems. For the limit q\to 1 one recovers the usual Boltzmann-Gibbs or Shannon entropy. In this sense, the Gini impurity is nothing but a variation of the usual entropy measure for decision trees.


Information gain

Used by the
ID3 ID3 is a metadata container most often used in conjunction with the MP3 audio file format. It allows information such as the title, artist, album, track number, and other information about the file to be stored in the file itself. ID3 is a '' ...
, C4.5 and C5.0 tree-generation algorithms.
Information gain Information is an abstract concept that refers to something which has the power to inform. At the most fundamental level, it pertains to the interpretation (perhaps formally) of that which may be sensed, or their abstractions. Any natur ...
is based on the concept of
entropy Entropy is a scientific concept, most commonly associated with states of disorder, randomness, or uncertainty. The term and the concept are used in diverse fields, from classical thermodynamics, where it was first recognized, to the micros ...
and
information content In information theory, the information content, self-information, surprisal, or Shannon information is a basic quantity derived from the probability of a particular event occurring from a random variable. It can be thought of as an alternative w ...
from
information theory Information theory is the mathematical study of the quantification (science), quantification, Data storage, storage, and telecommunications, communication of information. The field was established and formalized by Claude Shannon in the 1940s, ...
. Entropy is defined as below :\Eta(T) = \operatorname_\left(p_1, p_2, \ldots, p_J\right) = - \sum^J_ p_i \log_2 p_i where p_1, p_2, \ldots are fractions that add up to 1 and represent the percentage of each class present in the child node that results from a split in the tree. : \overbrace^\text = \overbrace^\text - \overbrace^\text =-\sum_^J p_i\log_2 p_i - \sum_^J - \Pr(i\mid a)\log_2 \Pr(i\mid a) Averaging over the possible values of A, : \overbrace^\text = \overbrace^ = \overbrace^\text - \overbrace^\text =-\sum_^J p_i\log_2 p_i - \sum_a p(a)\sum_^J-\Pr(i\mid a) \log_2 \Pr(i\mid a) :Where weighted sum of entropies is given by, := \sum_a p(a)\sum_^J-\Pr(i\mid a) \log_2 \Pr(i\mid a) That is, the expected information gain is the
mutual information In probability theory and information theory, the mutual information (MI) of two random variables is a measure of the mutual Statistical dependence, dependence between the two variables. More specifically, it quantifies the "Information conten ...
, meaning that on average, the reduction in the entropy of ''T'' is the mutual information. Information gain is used to decide which feature to split on at each step in building the tree. Simplicity is best, so we want to keep our tree small. To do so, at each step we should choose the split that results in the most consistent child nodes. A commonly used measure of consistency is called
information Information is an Abstraction, abstract concept that refers to something which has the power Communication, to inform. At the most fundamental level, it pertains to the Interpretation (philosophy), interpretation (perhaps Interpretation (log ...
which is measured in
bit The bit is the most basic unit of information in computing and digital communication. The name is a portmanteau of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represented as ...
s. For each node of the tree, the information value "represents the expected amount of information that would be needed to specify whether a new instance should be classified yes or no, given that the example reached that node". Consider an example data set with four attributes: ''outlook'' (sunny, overcast, rainy), ''temperature'' (hot, mild, cool), ''humidity'' (high, normal), and ''windy'' (true, false), with a binary (yes or no) target variable, ''play'', and 14 data points. To construct a decision tree on this data, we need to compare the information gain of each of four trees, each split on one of the four features. The split with the highest information gain will be taken as the first split and the process will continue until all children nodes each have consistent data, or until the information gain is 0. To find the information gain of the split using ''windy'', we must first calculate the information in the data before the split. The original data contained nine yes's and five no's. : I_E( ,5 = -\frac 9 \log_2 \frac 9 - \frac 5 \log_2 \frac 5 = 0.94 The split using the feature ''windy'' results in two children nodes, one for a ''windy'' value of true and one for a ''windy'' value of false. In this data set, there are six data points with a true ''windy'' value, three of which have a ''play'' (where ''play'' is the target variable) value of yes and three with a ''play'' value of no. The eight remaining data points with a ''windy'' value of false contain two no's and six yes's. The information of the ''windy''=true node is calculated using the entropy equation above. Since there is an equal number of yes's and no's in this node, we have : I_E( ,3 = -\frac 3 6\log_2 \frac 3 6 - \frac 3 6\log_2 \frac 3 6 = -\frac 1 2\log_2 \frac 1 2 - \frac 1 2\log_2 \frac 1 2 = 1 For the node where ''windy''=false there were eight data points, six yes's and two no's. Thus we have : I_E( ,2 = -\frac 6 8\log_2 \frac 6 8 - \frac 2 8\log_2 \frac 2 8 = -\frac 3 4\log_2 \frac 3 4 - \frac 1 4\log_2 \frac 1 4 = 0.81 To find the information of the split, we take the weighted average of these two numbers based on how many observations fell into which node. : I_E( ,3 ,2 = I_E(\text) = \frac 6 \cdot 1 + \frac 8 \cdot 0.81 = 0.89 Now we can calculate the information gain achieved by splitting on the ''windy'' feature. : \operatorname(\text) = I_E( ,5 - I_E( ,3 ,2 = 0.94 - 0.89 = 0.05 To build the tree, the information gain of each possible first split would need to be calculated. The best first split is the one that provides the most information gain. This process is repeated for each impure node until the tree is complete. This example is adapted from the example appearing in Witten et al. Information gain is also known as Shannon index in bio diversity research.


Variance reduction

Introduced in CART, variance reduction is often employed in cases where the target variable is continuous (regression tree), meaning that use of many other metrics would first require discretization before being applied. The variance reduction of a node is defined as the total reduction of the variance of the target variable due to the split at this node: : I_V(N) = \frac\sum_ \sum_ \frac(y_i - y_j)^2 - \left(\frac\frac\sum_ \sum_ \frac(y_i - y_j)^2 + \frac\frac\sum_ \sum_ \frac(y_i - y_j)^2\right) where S, S_t, and S_f are the set of presplit sample indices, set of sample indices for which the split test is true, and set of sample indices for which the split test is false, respectively. Each of the above summands are indeed
variance In probability theory and statistics, variance is the expected value of the squared deviation from the mean of a random variable. The standard deviation (SD) is obtained as the square root of the variance. Variance is a measure of dispersion ...
estimates, though, written in a form without directly referring to the mean. By replacing (y_i - y_j)^2 in the formula above with the dissimilarity d_ between two objects i and j, the variance reduction criterion applies to any kind of object for which pairwise dissimilarities can be computed.


Measure of "goodness"

Used by CART in 1984, the measure of "goodness" is a function that seeks to optimize the balance of a candidate split's capacity to create pure children with its capacity to create equally-sized children. This process is repeated for each impure node until the tree is complete. The function \varphi(s\mid t), where s is a candidate split at node t, is defined as below : \varphi(s\mid t) = 2P_L P_R \sum_^\text, P(j\mid t_L) - P(j\mid t_R), where t_L and t_R are the left and right children of node t using split s, respectively; P_L and P_R are the proportions of records in t in t_L and t_R, respectively; and P(j\mid t_L) and P(j\mid t_R) are the proportions of class j records in t_L and t_R, respectively. Consider an example data set with three attributes: ''savings''(low, medium, high), ''assets''(low, medium, high), ''income''(numerical value), and a binary target variable ''credit risk''(good, bad) and 8 data points. The full data is presented in the table below. To start a decision tree, we will calculate the maximum value of \varphi(s\mid t) using each feature to find which one will split the root node. This process will continue until all children are pure or all \varphi(s\mid t) values are below a set threshold. To find \varphi(s\mid t) of the feature ''savings'', we need to note the quantity of each value. The original data contained three low's, three medium's, and two high's. Out of the low's, one had a good ''credit risk'' while out of the medium's and high's, 4 had a good ''credit risk''. Assume a candidate split s such that records with a low ''savings'' will be put in the left child and all other records will be put into the right child. : \varphi(s\mid\text) = 2\cdot\frac 3 8\cdot\frac 5 8\cdot \left(\left, \left(\frac 1 3 - \frac 4 5\right)\ + \left, \left(\frac 2 3 - \frac 1 5\right)\\right) = 0.44 To build the tree, the "goodness" of all candidate splits for the root node need to be calculated. The candidate with the maximum value will split the root node, and the process will continue for each impure node until the tree is complete. Compared to other metrics such as information gain, the measure of "goodness" will attempt to create a more balanced tree, leading to more-consistent decision time. However, it sacrifices some priority for creating pure children which can lead to additional splits that are not present with other metrics.


Uses


Advantages

Amongst other data mining methods, decision trees have various advantages: * Simple to understand and interpret. People are able to understand decision tree models after a brief explanation. Trees can also be displayed graphically in a way that is easy for non-experts to interpret. * Able to handle both numerical and categorical data. Other techniques are usually specialized in analyzing datasets that have only one type of variable. (For example, relation rules can be used only with nominal variables while neural networks can be used only with numerical variables or categoricals converted to 0-1 values.) Early decision trees were only capable of handling categorical variables, but more recent versions, such as C4.5, do not have this limitation. * Requires little data preparation. Other techniques often require data normalization. Since trees can handle qualitative predictors, there is no need to create dummy variables. * Uses a white box or open-box model. If a given situation is observable in a model the explanation for the condition is easily explained by
Boolean logic In mathematics and mathematical logic, Boolean algebra is a branch of algebra. It differs from elementary algebra in two ways. First, the values of the variable (mathematics), variables are the truth values ''true'' and ''false'', usually denot ...
. By contrast, in a
black box In science, computing, and engineering, a black box is a system which can be viewed in terms of its inputs and outputs (or transfer characteristics), without any knowledge of its internal workings. Its implementation is "opaque" (black). The te ...
model, the explanation for the results is typically difficult to understand, for example with an
artificial neural network In machine learning, a neural network (also artificial neural network or neural net, abbreviated ANN or NN) is a computational model inspired by the structure and functions of biological neural networks. A neural network consists of connected ...
. * Possible to validate a model using statistical tests. That makes it possible to account for the reliability of the model. * Non-parametric approach that makes no assumptions of the training data or prediction residuals; e.g., no distributional, independence, or constant variance assumptions * Performs well with large datasets. Large amounts of data can be analyzed using standard computing resources in reasonable time. * Accuracy with flexible modeling. These methods may be applied to healthcare research with increased accuracy. * Mirrors human decision making more closely than other approaches. This could be useful when modeling human decisions/behavior. * Robust against co-linearity, particularly boosting. * In built
feature selection In machine learning, feature selection is the process of selecting a subset of relevant Feature (machine learning), features (variables, predictors) for use in model construction. Feature selection techniques are used for several reasons: * sim ...
. Additional irrelevant feature will be less used so that they can be removed on subsequent runs. The hierarchy of attributes in a decision tree reflects the importance of attributes. It means that the features on top are the most informative. * Decision trees can approximate any
Boolean function In mathematics, a Boolean function is a function whose arguments and result assume values from a two-element set (usually , or ). Alternative names are switching function, used especially in older computer science literature, and truth functi ...
e.g.
XOR Exclusive or, exclusive disjunction, exclusive alternation, logical non-equivalence, or logical inequality is a logical operator whose negation is the logical biconditional. With two inputs, XOR is true if and only if the inputs differ (one ...
.


Limitations

* Trees can be very non-robust. A small change in the
training data In machine learning, a common task is the study and construction of algorithms that can learn from and make predictions on data. Such algorithms function by making data-driven predictions or decisions, through building a mathematical model from ...
can result in a large change in the tree and consequently the final predictions. * The problem of learning an optimal decision tree is known to be
NP-complete In computational complexity theory, NP-complete problems are the hardest of the problems to which ''solutions'' can be verified ''quickly''. Somewhat more precisely, a problem is NP-complete when: # It is a decision problem, meaning that for any ...
under several aspects of optimality and even for simple concepts. Consequently, practical decision-tree learning algorithms are based on heuristics such as the
greedy algorithm A greedy algorithm is any algorithm that follows the problem-solving heuristic of making the locally optimal choice at each stage. In many problems, a greedy strategy does not produce an optimal solution, but a greedy heuristic can yield locally ...
where locally optimal decisions are made at each node. Such algorithms cannot guarantee to return the globally optimal decision tree. To reduce the greedy effect of local optimality, some methods such as the dual information distance (DID) tree were proposed. * Decision-tree learners can create over-complex trees that do not generalize well from the training data. (This is known as
overfitting In mathematical modeling, overfitting is "the production of an analysis that corresponds too closely or exactly to a particular set of data, and may therefore fail to fit to additional data or predict future observations reliably". An overfi ...
.) Mechanisms such as
pruning Pruning is the selective removal of certain parts of a plant, such as branches, buds, or roots. It is practiced in horticulture (especially fruit tree pruning), arboriculture, and silviculture. The practice entails the targeted removal of di ...
are necessary to avoid this problem (with the exception of some algorithms such as the Conditional Inference approach, that does not require pruning). * The average depth of the tree that is defined by the number of nodes or tests till classification is not guaranteed to be minimal or small under various splitting criteria. * For data including categorical variables with different numbers of levels, information gain in decision trees is biased in favor of attributes with more levels. To counter this problem, instead of choosing the attribute with highest
information gain Information is an abstract concept that refers to something which has the power to inform. At the most fundamental level, it pertains to the interpretation (perhaps formally) of that which may be sensed, or their abstractions. Any natur ...
, one can choose the attribute with the highest information gain ratio among the attributes whose information gain is greater than the mean information gain. This biases the decision tree against considering attributes with a large number of distinct values, while not giving an unfair advantage to attributes with very low information gain. Alternatively, the issue of biased predictor selection can be avoided by the Conditional Inference approach, a two-stage approach, or adaptive leave-one-out feature selection.


Implementations

Many data mining software packages provide implementations of one or more decision tree algorithms (e.g. random forest). Open source examples include: *
ALGLIB ALGLIB is a cross-platform open source numerical analysis and data processing library. It can be used from several programming languages ( C++, C#, VB.NET, Python, Delphi, Java). ALGLIB started in 1999 and has a long history of steady developm ...
, a C++, C# and Java numerical analysis library with data analysis features (random forest) *
KNIME KNIME (), the Konstanz Information Miner, is a data analytics, reporting and integrating platform. KNIME integrates various components for machine learning and data mining through its modular data pipelining "Building Blocks of Analytics" con ...
, a free and open-source data analytics, reporting and integration platform (decision trees, random forest) *
Orange Orange most often refers to: *Orange (fruit), the fruit of the tree species '' Citrus'' × ''sinensis'' ** Orange blossom, its fragrant flower ** Orange juice *Orange (colour), the color of an orange fruit, occurs between red and yellow in the vi ...
, an open-source data visualization, machine learning and data mining toolkit (random forest) * R (an open-source software environment for statistical computing, which includes several CART implementations such as rpart, party and randomForest packages), * *
scikit-learn scikit-learn (formerly scikits.learn and also known as sklearn) is a free and open-source machine learning library for the Python programming language. It features various classification, regression and clustering algorithms including support ...
(a free and open-source machine learning library for the
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (prog ...
programming language). *
Weka The weka, also known as the Māori hen or woodhen (''Gallirallus australis'') is a flightless bird species of the rail family. It is endemic to New Zealand. Some authorities consider it as the only extant member of the genus '' Gallirallus''. ...
(a free and open-source data-mining suite, contains many decision tree algorithms), Notable commercial software: *
MATLAB MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementat ...
, *
Microsoft SQL Server Microsoft SQL Server is a proprietary relational database management system developed by Microsoft using Structured Query Language (SQL, often pronounced "sequel"). As a database server, it is a software product with the primary function of ...
, and *
RapidMiner RapidMiner is a data science platform that analyses the collective impact of an organization's data. It was acquired by Altair Engineering in September 2022. History RapidMiner, formerly known as YALE (Yet Another Learning Environment), was deve ...
, * * SAS Enterprise Miner, * IBM SPSS Modeler,


Extensions


Decision graphs

In a decision tree, all paths from the root node to the leaf node proceed by way of conjunction, or ''AND''. In a decision graph, it is possible to use disjunctions (ORs) to join two more paths together using minimum message length (MML). Decision graphs have been further extended to allow for previously unstated new attributes to be learnt dynamically and used at different places within the graph. The more general coding scheme results in better predictive accuracy and log-loss probabilistic scoring. In general, decision graphs infer models with fewer leaves than decision trees.


Alternative search methods

Evolutionary algorithms have been used to avoid local optimal decisions and search the decision tree space with little ''a priori'' bias. It is also possible for a tree to be sampled using MCMC. The tree can be searched for in a bottom-up fashion. Or several trees can be constructed parallelly to reduce the expected number of tests till classification.


See also

* Decision tree pruning *
Binary decision diagram In computer science, a binary decision diagram (BDD) or branching program is a data structure that is used to represent a Boolean function. On a more abstract level, BDDs can be considered as a compressed representation of sets or relations. Un ...
*
CHAID Chi-square automatic interaction detection (CHAID) is a decision tree technique based on adjusted significance testing (Bonferroni correction, Holm-Bonferroni testing). History CHAID is based on a formal extension of AID (Automatic Interaction De ...
*
CART A cart or dray (Australia and New Zealand) is a vehicle designed for transport, using two wheels and normally pulled by draught animals such as horses, donkeys, mules and oxen, or even smaller animals such as goats or large dogs. A handcart ...
*
ID3 algorithm In decision tree learning, ID3 (Iterative Dichotomiser 3) is an algorithm invented by Ross QuinlanQuinlan, J. R. 1986. Induction of Decision Trees. Mach. Learn. 1, 1 (Mar. 1986), 81–106 used to generate a decision tree from a dataset. ID3 is th ...
* C4.5 algorithm * Decision stumps, used in e.g.
AdaBoost AdaBoost (short for Adaptive Boosting) is a statistical classification meta-algorithm formulated by Yoav Freund and Robert Schapire in 1995, who won the 2003 Gödel Prize for their work. It can be used in conjunction with many types of learnin ...
ing *
Decision list Decision lists are a representation for Boolean functions which can be easily learnable from examples. Single term decision lists are more expressive than disjunctions and conjunctions; however, 1-term decision lists are less expressive than the ...
* Incremental decision tree *
Alternating decision tree An alternating decision tree (ADTree) is a machine learning method for classification. It generalizes decision trees and has connections to boosting. An ADTree consists of an alternation of decision nodes, which specify a predicate condition, and ...
*
Structured data analysis (statistics) Structured data analysis is the statistical data analysis of structured data. This can arise either in the form of an ''a priori'' structure such as multiple-choice questionnaires or in situations with the need to search for structure that fits t ...
* Logistic model tree *
Hierarchical clustering In data mining and statistics, hierarchical clustering (also called hierarchical cluster analysis or HCA) is a method of cluster analysis that seeks to build a hierarchy of clusters. Strategies for hierarchical clustering generally fall into two ...


References


Further reading

* {{cite book , first1=Gareth , last1=James , first2=Daniela , last2=Witten , first3=Trevor , last3=Hastie , first4=Robert , last4=Tibshirani , chapter=Tree-Based Methods , title=An Introduction to Statistical Learning: with Applications in R , location=New York , publisher=Springer , year=2017 , isbn=978-1-4614-7137-0 , chapter-url=https://www-bcf.usc.edu/~gareth/ISL/ISLR%20Seventh%20Printing.pdf#page=317 , pages=303–336


External links


Evolutionary Learning of Decision Trees in C++


Decision trees Classification algorithms