In decision tree learning, information gain ratio is a ratio of information gain to the intrinsic information. It was proposed by Ross Quinlan,[1] to reduce a bias towards multi-valued attributes by taking the number and size of branches into account when choosing an attribute.[2]

Information Gain is also known as Mutual Information.[3]

The image shows the information gain of a variable called "year" and shows the result of choosing a year 1 through 12. The information gain would favor this variable as the results would either be definitely positive or negative while also creating multiple leaf nodes, however, the problem is that none of these years will occur again. The next input would be year 13, but there is no branch to year 13 and that is a problem that can be solved with information gain ratio. Information gain ratio will normalize the data using the entropy value of that variable to remove the bias of multi-variable data and variables with multiple nodes compared to variables with a smaller set of nodes. This would remove the odds of the tree in the image from being created.
The image shows the information gain of a variable called "year" and shows the result of choosing a year 1 through 12. The information gain would favor this variable as the results would either be definitely positive or negative while also creating multiple leaf nodes, however, the problem is that none of these years will occur again. The next input would be year 13, but there is no branch to year 13 and that is a problem that can be solved with information gain ratio. Information gain ratio will normalize the data using the entropy value of that variable to remove the bias of multi-variable data and variables with multiple nodes compared to variables with a smaller set of nodes. This would remove the odds of the tree in the image from being created.

Information gain calculation

Information gain is the reduction in entropy produced from partitioning a set with attributes and finding the optimal candidate that produces the highest value:

where is a random variable and is the entropy of given the value of attribute .

The information gain is equal to the total entropy for an attribute if for each of the attribute values a unique classification can be made for the result attribute. In this case the relative entropies subtracted from the total entropy are 0.

Split Information calculation

The Split Information value for a test is defined as follows:

where is a discrete random variable with possible values and being the number of times that occurs divided by the total count of events where is the set of events.

The Split Information value is a positive number that describes the potential worth of splitting a branch from a node. This in turn is the intrinsic value that the random variable possesses and will be used to remove the bias in the Information Gain Ratio calculation.

Information gain ratio calculation

The information gain ratio is the ratio between the information gain and the Split Information value:

Example

Using weather data published by Fordham University,[4] the table was created below:

WEKA Weather Data
OutlookTemperatureHumidityWindPlay
sunnyhothighFALSENO
sunnyhothighTRUENO
overcasthothighFALSEYES
rainymildhighFALSEYES
rainycoolnormalFALSEYES
rainycoolnormalTRUENO
overcastcoolnormalTRUEYES
sunnymildhighFALSENO
sunnycoolnormalFALSEYES
rainymildnormalFALSEYES
sunnymildnormalTRUEYES
overcastmildhighTRUEYES
overcasthotnormalFALSEYES
rainymildhighTRUENO

Using the table above, one can find the Entropy, Information Gain, Split Information, and Information Gain Ratio for each variable (Outlook, Temperature, Humidity, and Wind). These calculations are shown in the tables below:

Outlook Table
OutlookYESNOCount of each groupEntropy
sunny2350.971
overcast4040.000
rainy3250.971
ResultsValues
Information0.694
Overall Entropy0.940
Information Gain0.247
Split Information1.577
Gain Ratio0.156
Temperature Table
TemperatureYESNOCount of each groupEntropy
hot2241.000
mild4260.918
cool3140.811
ResultsValues
Information0.911
Overall Entropy0.940
Information Gain0.029
Split Information1.557
Gain Ratio0.019
Wind Table
WindYESNOCount of each groupEntropy
FALSE6280.811
TRUE3361.000
ResultsValues
Information0.892
Overall Entropy0.940
Information Gain0.048
Split Information0.985
Gain Ratio0.049
Humidity Table
HumidityYESNOCount of each groupEntropy
high3470.985
normal6170.592
ResultsValues
Information0.788
Overall Entropy0.940
Information Gain0.152
Split Information1.000
Gain Ratio0.152

Using the above tables, one can deduce that Outlook has the highest information gain ratio. Next, one must find the statistics for the sub-groups of the Outlook variable (sunny, overcast, and rainy), for this example one will only build the sunny branch (as shown in the table below):

Outlook Table
OutlookTemperatureHumidityWindPlay
sunnyhothighFALSENO
sunnyhothighTRUENO
sunnymildhighFALSENO
sunnycoolnormalFALSEYES
sunnymildnormalTRUEYES

One can find the following statistics for the other variables (temperature, humidity, and wind) to see which have the greatest effect on the sunny element of the Outlook variable:

Temperature Table
TemperatureYESNOCount of each groupEntropy
hot0220.000
mild1121.000
cool1010.000
ResultsValues
Information0.400
Overall Entropy0.971
Gain0.571
Split Information1.522
Gain Ratio0.375
Wind Table
WindYESNOCount of each groupEntropy
FALSE1230.918
TRUE1121.000
ResultsValues
Information0.951
Overall Entropy0.971
Gain0.020
Split Information0.971
Gain Ratio0.021
Humidity Table
HumidityYESNOCount of each groupEntropy
high0330.000
normal2020.000
ResultsValues
Information0.000
Overall Entropy0.971
Gain0.971
Split Information0.971
Gain Ratio1.000

Humidity was found to have the highest information gain ratio. One will repeat the same steps as before and find the statistics for the events of the Humidity variable (high and normal):

Humidity-high Table
HumidityWindPlay
highFALSENO
highTRUENO
highFALSENO
Humidity-normal Table
HumidityWindPlay
normalFALSEYES
normalTRUEYES

Since the Play values are either all "NO" or "YES", the information gain ratio value will be equal to 1. Also, now that one has reached the end of the variable chain with Wind being the last variable left, they can build an entire root to leaf node branch line of a decision tree.

Alt text

Once finished with reaching this leaf node, one would follow the same procedure for the rest of the elements that have yet to be split in the decision tree. This set of data was relatively small, however, if a larger set was used, the advantages of using the information gain ratio as the splitting factor of a decision tree can be seen more.

Advantages

  1. Information gain ratio biases the decision tree against considering attributes with a large number of distinct values.
    • Example: Suppose that we are building a decision tree for some data describing a business's customers. Information gain ratio is used to decide which of the attributes are the most relevant. These will be tested near the root of the tree. One of the input attributes might be the customer's telephone number. This attribute has a high information gain, because it uniquely identifies each customer. Due to its high amount of distinct values, this will not be chosen to be tested near the root.

Disadvantages

  1. Although information gain ratio solves the key problem of information gain, it creates another problem. If one is considering an amount of attributes that have a high number of distinct values, these will never be above one that has a lower number of distinct values.

Difference From Information Gain

  • Information gain's shortcoming is created by not providing a numerical difference between attributes with high distinct values from those that have less.
    • Example: Suppose that we are building a decision tree for some data describing a business's customers. Information gain is often used to decide which of the attributes are the most relevant, so they can be tested near the root of the tree. One of the input attributes might be the customer's credit card number. This attribute has a high information gain, because it uniquely identifies each customer, but we do not want to include it in the decision tree: deciding how to treat a customer based on their credit card number is unlikely to generalize to customers we haven't seen before.
  • Information gain ratio's strength is that it has a bias towards the attributes with the lower number of distinct values.
  • Below is a table describing the differences of Information Gain and Information Gain Ratio when put in certain scenarios.
Situational Differences Between Information Gain and Information Gain Ratio
Information GainInformation Gain Ratio
Will not favor any attributes by number of distinct valuesWill favor attribute that have a lower number of distinct values
When applied to attributes that can take on a large number of distinct values, this technique might learn the training set too wellUser will struggle if required to find attributes requiring a high number of distinct values

See also

References

  1. Quinlan, J. Ross. "Induction of decision trees." Machine learning 1.1 (1986): 81-106.
  2. http://www.ke.tu-darmstadt.de/lehre/archiv/ws0809/mldm/dt.pdf
  3. "Information gain, mutual information and related measures".
  4. https://storm.cis.fordham.edu/~gweiss/data-mining/weka-data/weather.nominal.arff
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.