Information gain ratio

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Information gain ratio is between 0 and 1, cf. ordinary information gain

Information Gain Calculation[edit]

Let Attr be the set of all attributes and Ex the set of all training examples, value(x,a) with x\in Ex defines the value of a specific example x for attribute a\in Attr, H specifies the entropy. The information gain for an attribute a\in Attr is defined as follows:

IG(Ex,a)=H(Ex) -\sum_{v\in values(a)} \left(\frac{|\{x\in Ex|value(x,a)=v\}|}{|Ex|} \cdot H(\{x\in Ex|value(x,a)=v\})\right)

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.

Intrinsic Value Calculation[edit]

The intrinsic value for a test is defined as follows:

IV(Ex,a)= -\sum_{v\in values(a)} \frac{|\{x\in Ex|value(x,a)=v\}|}{|Ex|} * \log_2\left(\frac{|\{x\in Ex|value(x,a)=v\}|}{|Ex|}\right)

Information Gain Ratio Calculation[edit]

The information gain ratio is just the ratio between the information gain and the intrinsic value: IGR(Ex,a)=IG / IV

Advantages[edit]

Information gain ratio biases the decision tree against considering attributes with a large number of distinct values. So it solves the drawback of information gain—namely, information gain applied to attributes that can take on a large number of distinct values might learn the training set too well. For 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.