"Machine Learning Algorithm Foundation + Combat series" Decision tree algorithm

Source: Internet
Author: User

A decision tree is a basic classification and regression model, which means that it can be used for both classification and regression. Here, take the classification as an example.
Decision tree Model A tree structure that describes the classification of instances by characteristics, which consists of a root node, several internal nodes, and several leaf nodes. The leaf node corresponds to the decision result, or it can be said to be a class, the internal node represents a property and characteristics.
The learning algorithm of decision tree consists of three steps: Feature selection, decision tree generation, pruning of decision tree

Feature Selection

Feature selection is to choose the characteristics of the training data has a good classification ability, if the selected characteristics of the classification results and the results of random classification is not very different, then it can not be said that this feature has a good classification ability. In terms of experience, throwing away these features will not affect the accuracy of the decision tree learning.
The criteria for General feature selection are the information gain or the information gain ratio we are taking.

Information gain:

First we give the definition of entropy: The uncertainty of the random variable represented by entropy.
Set \ (x\) is a discrete random variable with a finite number of values, with a probability distribution of:\[p (X=x_{i}) =p_{i}, i =,..., n\]
The entropy of the random variable is defined as: \[H (X) =-\sum_{i=1}^{n}p_{i}logp_{i}\]
Normally, the logarithm in the equation is based on 2 or E. If \ (P_{i} = 0, define 0log0=0\). By defining the formula we can tell that entropy depends only on the distribution of X, and not on the value of X. So we can also rewrite this equation:\[H (P) =-\sum_{i=1}^{n}p_{i}logp_{i}\]
The greater the entropy, the greater the uncertainty of the random variable, from which we can know:\ (0\leq H (p) \leq logn\)
Next we give a definition of conditional entropy. With a random variable (x, y), its joint probability distribution is

"Machine Learning Algorithm Foundation + Combat series" Decision tree algorithm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.