ArticleslgStudy

computer science

Information gain (decision tree)

Information gain (decision tree) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Information gain (decision tree) rather than just read about it. In short: In the context of decision trees in information theory and machine learning, information gain refers to the conditional expected value of the Kullback–Leibler divergence of the univariate probability distribution of one variable from the conditional distribution of this variable given the other one. (In broader contexts, information gain can also be used as a synonym for either Kullback–Leibler divergence or mutual…

Information gain (decision tree) — main illustration
Information gain (decision tree) — illustration

Key takeaways

  • Information gain (decision tree) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Information gain (decision tree) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Information gain (decision tree) from memory before moving on to harder problems.

Reference excerpt

In the context of decision trees in information theory and machine learning, information gain refers to the conditional expected value of the Kullback–Leibler divergence of the univariate probability distribution of one variable from the conditional distribution of this variable given the other one. (In broader contexts, information gain can also be used as a synonym for either Kullback–Leibler divergence or mutual information, but the focus of this article is on the more narrow meaning below.) Explicitly, the information gain of a random variable X {\displaystyle X} obtained from an observation of a random variable A {\displaystyle A} taking value a {\displaystyle a} is defined as:

I G ( X , a ) = D KL ( P X ∣ a ∥ P X ) {\displaystyle {\mathit {IG}}(X,a)=D_{\text{KL}}{\bigl (}P_{X\mid a}\parallel P_{X}{\bigr )}}

In other words, it is the Kullback–Leibler divergence of P X ( x ) {\displaystyle P_{X}(x)} (the prior distribution for X {\displaystyle X} ) from P X ∣ a ( x ) {\displaystyle P_{X\mid a}(x)} (the posterior distribution for X {\displaystyle X} given A = a {\displaystyle A=a} ). The expected value of the information gain is the mutual information I ( X ; A ) {\displaystyle I(X;A)} :

E A ⁡ [ I G ( X , A ) ] = I ( X ; A ) {\displaystyle \operatorname {E} _{A}[{\mathit {IG}}(X,A)]=I(X;A)}

i.e. the reduction in the entropy of X {\displaystyle X} achieved by learning the state of the random variable A {\displaystyle A} . In machine learning, this concept can be used to define a preferred sequence of attributes to investigate to most rapidly narrow down the state of X. Such a sequence (which depends on the outcome of the investigation of previous attributes at each stage) is called a decision tree, and when applied in the area of machine learning is known as decision tree learning. Usually, attributes with high mutual information with the target variable are preferred, since mutual information is equivalent to the expected reduction in entropy (information gain) obtained by splitting on that attribute.

General definition In general terms, the expected information gain is the reduction in information entropy Η from a prior state to a state that takes some information as given:

I G ( T , a ) = H ( T ) − H ( T | a ) , {\displaystyle IG(T,a)=\mathrm {H} {(T)}-\mathrm {H} {(T|a)},}

where H ( T | a ) {\displaystyle \mathrm {H} {(T|a)}} is the conditional entropy of T {\displaystyle T} given the value of attribute a {\displaystyle a} . This is intuitively plausible when interpreting entropy Η as a measure of uncertainty of a random variable T {\displaystyle T} : by learning (or assuming) a {\displaystyle a} about T {\displaystyle T} , our uncertainty about T {\displaystyle T} is reduced (i.e. I G ( T , a ) {\displaystyle IG(T,a)} is positive), unless of course T {\displaystyle T} is independent of a {\displaystyle a} , in which case H ( T | a ) = H ( T ) {\displaystyle \mathrm {H} (T|a)=\mathrm {H} (T)} , meaning I G ( T , a ) = 0 {\displaystyle IG(T,a)=0} .

… excerpt ends here. Continue reading the full article.

Illustrations

Information gain (decision tree): A simple decision tree
A simple decision tree
Information gain (decision tree): The newly created tree with the root node split based on Mutation 3. Mutation 3 had the highest information gain, so it was selected as the split.
The newly created tree with the root node split based on Mutation 3. Mutation 3 had the highest information gain, so it was selected as the split.
Information gain (decision tree): The updated tree with the right child node split based on Mutation 4.
The updated tree with the right child node split based on Mutation 4.
Information gain (decision tree): Testing the decision tree with two new samples.
Testing the decision tree with two new samples.

Worked examples

Example 1 — a first encounter with Information gain (decision tree)

Start with the simplest possible case. Write down what Information gain (decision tree) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Information gain (decision tree) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Information gain (decision tree) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Information gain (decision tree)

In research
Information gain (decision tree) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Information gain (decision tree) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Information gain (decision tree) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Classification algorithms, Decision trees, so understanding it makes those chapters shorter.
In everyday life
Look for Information gain (decision tree) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Information gain (decision tree)” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Information gain (decision tree) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Information gain (decision tree) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Information gain (decision tree) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Information gain (decision tree) in simple terms?

In the context of decision trees in information theory and machine learning, information gain refers to the conditional expected value of the Kullback–Leibler divergence of the univariate probability distribution of one variable from the conditional distribution of this variable given the other one…

Why does Information gain (decision tree) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Information gain (decision tree)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Information gain (decision tree).

Tags

  • Classification algorithms
  • Decision trees

Keep exploring