Nodes
- Split for the value of a certain attribute
Edges
- Outcome of a split to next node
Root
- The node that performs the first split
Leaves
- Terminal nodes that predict the outcome

Information gain is the (Beginning entropy )- (sum of the entropy of the terminal nodes)


Example of Entropy
- There's a node with 3 reds, 3 greens

- Entropy is calculated as below:

GINI Index could also be used:
- How to calculate GINI Index

- Calculating a GINI Index



- Beginning Entropy :

- Entropy of the leaf nodes :


- Information Gain :
0.815-0.6075 = 0.2075
The more nodes you create , higher is the Information Gain. But is this a good model?
- That's where GR comes in
How you calculate GR

Example
- an example model

- Denominator of each model


- Calculating GR


Selecting random features/ rows from data with replacement
Bagging Features
- If you choose the features to split on, like the traditional decision tree model, the models are likely to start spliting with the same feature (the strongest feature)
Bagging Rows
- You also do the same for rows
The Contents of this post belongs to Jose Portilla's Python for Data Science and Machine Learning Bootcamp and 유나의 공부