The core of the ID3 algorithm is to apply information gain criteria to select features on each node of the decision tree, and build the decision tree recursively.
The ID in the ID3 name is the abbreviation of It-erative Dichotomiser.
This tree-building algorithm uses information gain (not information gain rate!) to perform feature selection, and information gain is obtained by subtracting two entropies, which is the entropy after feature splitting minus before splitting Entropy of the node.
What is entropy? Entropy is a kind of uncertainty. At the beginning, the entropy of your data must be the largest. The purpose of your establishment is to reduce the uncertainty of your data step by step. The land is reduced to make the data in a node more pure (that is, we said that the classification is good).
When the current entropy is given, what we have to do is to make the split entropy (entropy(D,A)) as small as possible.
The data processed by the ID3 algorithm is discrete, and its basic algorithm process is as follows:
Create Root node
If Examples are all positive,
Then return label=Positive single node number Root
If Examples are all subs,
Then return the number of single nodes of label= Vice Root
If Attribute is empty,
Then return the value of the most common Target_attribute in Root,label=Example.
Otherwise
A←Atrribute the attribute with the best ability to classify Eaxmples (*)
Root's decision attributes←A
For every possible value of A Vi
Add a new branch under Root to test A=Vi
Let Examplevi be a subset of Examples satisfying the attribute value of A as Vi
If Example is empty
Under the new branch, add a leaf node,
Node label=the most common Target_attribute value in the example.
Otherwise
Under the new branch, add a subtree of ID3 (including all satisfied examples, all labels, but the feature number -1).
End
Return to Root
Starting from the root node, calculate the information gain of all possible features for the node, select the feature with the largest information gain as the feature of the node, and establish the child node from the different values of the node; then recursively calculate the child node Call the above methods to build a decision tree; until the information gain of all features is small or there are no features to choose from. Finally, a decision tree is obtained.
In general, the theory is clear, the method is simple, and the learning ability is strong
The shortcomings of the ID3 algorithm are also obvious. As we said above, the ID3 algorithm will select features with many subcategories, because the result of this split will be purer and the entropy will be smaller. This is biased to our original intention. The pureness is not the pureness that is obtained by making it more detailed! If so, it's better to divide it into 100 categories. The purity of the data is very high.
So I summarized some shortcomings of the ID3 algorithm:
In the ID3 algorithm, generally speaking, we make judgments based on information gain. The greater the information gain, the greater the "purity improvement" obtained by using the attribute a for division.
In information gain, there is also a concept of "information entropy".
Assume that the current sample set D
The proportion of class samples is
, Then the information entropy of D is defined as:

The formula for information gain is:

Because the number of samples contained in different branch nodes is different, the weight assigned to the branch node, that is, the more the number of samples, the greater the influence of the branch node.
So, ID3 algorithm will tend to feature more feature options
Article Directory Advantages of Token authentication 1. Stateless 2. Effectively avoid CSRF attacks 3. Suitable for mobile applications 4. Single sign-on friendly Token authentication common problems ...
forward from: The advantages and disadvantages of java8-3 polymorphism and the understanding of polymorphism The benefits of polymorphism: A: Improve the maintainability of the code (inheritance guara...
Recognize strategic patterns Focus of Strategy Pattern The focus of the strategy pattern is not how to implement algorithms, but how to organize and call these algorithms, so that the program struct...
[VUE] Talk about your understanding of the SPA single page, what is its advantages and disadvantages? Personal profile I am a song, welcome to communicate with you. Abandon it is easy, But persistence...
advantage: (1) The naive Bayesian model originated from classical mathematical theory and has stable classification efficiency. (2) It works well for small-scale data, can handle multi-classification ...
Question: Find the sum of 1+2+3+4+5+...+n Recursive code while Recursion is the function call itself, and the loop is executing a piece of code while satisfying the condition. Recursive Advantages: Th...
Scheduling algorithmAccording to the resource allocation algorithm specified in resource allocation policy system. Some scheduling algorithm is suitable forJob SchedulingSome apply toProcess Schedulin...
Background: In order to solve the lack of labeling-clearance algorithms in garbage collection efficiency, M.L.minsky published a famous paper in 1963, "using the Lisp Language Garbage Collector C...
ID3 (Iterative Dichotomiser 3) classification algorithm is a prediction algorithm presented in 1975 at the University of Sydney by the Luo Sikun (J. Ross Quinlan), the core algorithm is the "info...
Recently, when I read the "Recommended System Development Actual Combat" -The Book of Gaoyang Group, I gave an example of the decision tree ID3 process. I think it's better, here is a record...