<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=ID3_algorithm</id>
	<title>ID3 algorithm - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=ID3_algorithm"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=ID3_algorithm&amp;action=history"/>
	<updated>2026-10-26T06:11:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki143/index.php?title=ID3_algorithm&amp;diff=1425831&amp;oldid=prev</id>
		<title>imported&gt;BarFriedrich: Fixed missing period.</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=ID3_algorithm&amp;diff=1425831&amp;oldid=prev"/>
		<updated>2024-07-01T18:04:46Z</updated>

		<summary type="html">&lt;p&gt;Fixed missing period.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Decision tree algorithm}}&lt;br /&gt;
[[File:ID3 algorithm decision tree.svg|thumb|Potential ID3-generated decision tree. Attributes are arranged as nodes by ability to classify examples. Values of attributes are represented by branches.]]&lt;br /&gt;
In [[decision tree learning]], &amp;#039;&amp;#039;&amp;#039;ID3&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;Iterative Dichotomiser 3&amp;#039;&amp;#039;&amp;#039;) is an [[algorithm]] invented by [[Ross Quinlan]]&amp;lt;ref&amp;gt;Quinlan, J. R. 1986. Induction of Decision Trees. Mach. Learn. 1, 1 (Mar. 1986), 81–106&amp;lt;/ref&amp;gt; used to generate a [[decision tree learning|decision tree]] from a dataset. ID3 is the precursor to the [[C4.5 algorithm]], and is typically used in the [[machine learning]] and [[natural language processing]] domains.&lt;br /&gt;
==Algorithm==&lt;br /&gt;
The ID3 algorithm begins with the original set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; as the [[root node]]. On each [[iteration]] of the algorithm, it iterates through every unused [[Feature (machine learning)|attribute]] of the set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and calculates the [[Entropy (information theory)|entropy]] &amp;lt;math&amp;gt;\Eta{(S)}&amp;lt;/math&amp;gt; or the [[Information gain in decision trees|information gain]] &amp;lt;math&amp;gt;IG(S)&amp;lt;/math&amp;gt; of that attribute. It then selects the attribute which has the smallest entropy (or largest information gain) value. The set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is then split or [[Partition of a set|partitioned]] by the selected attribute to produce subsets of the data. (For example, a node can be split into [[child node]]s based upon the subsets of the population whose ages are less than 50, between 50 and 100, and greater than 100.) The algorithm continues to [[Recursion (computer science)|recurse]] on each subset, considering only attributes never selected before.&lt;br /&gt;
&lt;br /&gt;
Recursion on a subset may [[Base case (recursion)|stop]] in one of these cases:&lt;br /&gt;
&lt;br /&gt;
* every element in the subset belongs to the same class; in which case the node is turned into a [[leaf node]] and labelled with the class of the examples.&lt;br /&gt;
* there are no more attributes to be selected, but the examples still do not belong to the same class. In this case, the node is made a leaf node and labelled with the [[Mode (statistics)|most common class]] of the examples in the subset.&lt;br /&gt;
* there are [[Empty set|no examples in the subset]], which happens when no example in the parent set was found to match a specific value of the selected attribute.  An example could be the absence of a person among the [[Population (statistics)|population]] with age over 100 years. Then a leaf node is created and labelled with the most common class of the examples in the parent node&amp;#039;s set.&lt;br /&gt;
&lt;br /&gt;
Throughout the algorithm, the decision tree is constructed with each non-terminal node ([[internal node]]) representing the selected [[Feature (machine learning)|attribute]] on which the data was split, and terminal nodes (leaf nodes) representing the class label of the final subset of this branch.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
# Calculate the [[Entropy (information theory)|entropy]] of every [[Feature (machine learning)|attribute]] &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; of the data set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
# Partition (&amp;quot;split&amp;quot;) the set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; into [[subset]]s using the attribute for which the [[Posterior distribution|resulting]] entropy after splitting is [[Minimum|minimized]]; or, equivalently, information gain is [[maximum]].&lt;br /&gt;
# Make a decision tree [[Node (computer science)|node]] containing that attribute.&lt;br /&gt;
# Recurse on subsets using the remaining attributes.&lt;br /&gt;
&lt;br /&gt;
===Properties===&lt;br /&gt;
[[File:ID3 decision tree- splicing.png|thumb|ID3-generated decision tree used to determine whether a particular nucleotide pair within a pre-mRNA sequence corresponds to an mRNA splice site. This tree has been shown to have a 95% correct prediction rate.&amp;lt;ref&amp;gt;{{Cite journal|last=Taggart|first=Allison J|last2=DeSimone|first2=Alec M|last3=Shih|first3=Janice S|last4=Filloux|first4=Madeleine E|last5=Fairbrother|first5=William G|date=2012-06-17|title=Large-scale mapping of branchpoints in human pre-mRNA transcripts in vivo|journal=Nature Structural &amp;amp; Molecular Biology|volume=19|issue=7|pages=719–721|doi=10.1038/nsmb.2327|issn=1545-9993|pmc=3465671|pmid=22705790}}&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
ID3 does not guarantee an optimal solution. It can converge upon [[Local optimum|local optima]]. It uses a [[Greedy algorithm|greedy strategy]] by selecting the locally best attribute to split the dataset on each iteration.  The [[algorithm&amp;#039;s optimality]] can be improved by using [[backtracking]] during the search for the optimal decision tree at the cost of possibly taking longer.&lt;br /&gt;
&lt;br /&gt;
ID3 can [[Overfitting|overfit]] the training data. To avoid overfitting, smaller decision trees should be preferred over larger ones.{{Explain|reason=Why are they preferred?|date=October 2018}}  This algorithm usually produces small trees, but it does not always produce the smallest possible decision tree.&lt;br /&gt;
&lt;br /&gt;
ID3 is harder to use on continuous data than on factored data (factored data has a discrete number of possible values, thus reducing the possible branch points).  If the values of any given attribute are [[Continuous variable|continuous]], then there are many more places to split the data on this attribute, and searching for the best value to split by can be time-consuming.&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
The ID3 algorithm is used by training on a [[data set]] &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; to produce a [[decision tree]] which is stored in [[Computer memory|memory]].  At [[Run time (program lifecycle phase)|runtime]], this decision tree is used to [[Statistical classification|classify]] new test cases ([[feature vector]]s) by [[Tree traversal|traversing]] the decision tree using the features of the datum to arrive at a leaf node.&lt;br /&gt;
&lt;br /&gt;
==The ID3 metrics==&lt;br /&gt;
&lt;br /&gt;
===Entropy===&lt;br /&gt;
[[Entropy (information theory)|Entropy]] &amp;lt;math&amp;gt;\Eta{(S)}&amp;lt;/math&amp;gt; is a measure of the amount of uncertainty in the (data) set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; (i.e. entropy characterizes the (data) set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \Eta{(S)} = \sum_{x \in X}{-p(x) \log_{2}p(x)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where,&lt;br /&gt;
* &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; – The [[Local variable|current dataset]] for which entropy is being calculated &lt;br /&gt;
**This changes at each step of the ID3 algorithm, either to a subset of the previous set in the case of splitting on an attribute or to a &amp;quot;sibling&amp;quot; partition of the parent in case the recursion terminated previously.&lt;br /&gt;
* &amp;lt;math&amp;gt;X&amp;lt;/math&amp;gt; – The set of classes in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;p(x)&amp;lt;/math&amp;gt; – The [[Proportion (mathematics)|proportion]] of the [[Cardinality|number of elements]] in class &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; to the number of elements in set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\Eta{(S)} = 0&amp;lt;/math&amp;gt;, the set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is perfectly classified (i.e. all elements in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; are of the same class).&lt;br /&gt;
&lt;br /&gt;
In ID3, entropy is calculated for each remaining attribute.  The attribute with the &amp;#039;&amp;#039;&amp;#039;smallest&amp;#039;&amp;#039;&amp;#039; entropy is used to split the set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; on this iteration.  Entropy in [[information theory]] measures how much information is [[Expected value|expected]] to be gained upon [[Sampling (signal processing)|measuring]] a [[random variable]]; as such, it can also be used to quantify the amount to which the [[Probability distribution|distribution]] of the quantity&amp;#039;s values is unknown.  A [[Constant (mathematics)|constant]] quantity has zero entropy, as its distribution is [[Complete information|perfectly known]].  In contrast, a uniformly distributed random variable ([[Discrete uniform distribution|discretely]] or [[Continuous uniform distribution|continuously]] uniform) maximizes entropy.  Therefore, the greater the entropy at a node, the less information is known about the classification of data at this stage of the tree; and therefore, the greater the potential to improve the classification here.&lt;br /&gt;
&lt;br /&gt;
As such, ID3 is a [[Greedy algorithm|greedy]] [[Heuristic (computer science)|heuristic]] performing a [[best-first search]] for [[locally optimal]] entropy values. Its accuracy can be improved by preprocessing the data.&lt;br /&gt;
&lt;br /&gt;
=== Information gain ===&lt;br /&gt;
[[Information gain in decision trees|Information gain]] &amp;lt;math&amp;gt;IG(A)&amp;lt;/math&amp;gt; is the measure of the difference in entropy from before to after the set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; is split on an attribute &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;. In other words, how much uncertainty in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; was reduced after splitting set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; on attribute &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; IG(S, A) = \Eta{(S)} - \sum_{t \in T} p(t)\Eta{(t)}&lt;br /&gt;
    = \Eta{(S)} - \Eta{(S|A)}. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where,&lt;br /&gt;
*&amp;lt;math&amp;gt;\Eta(S)&amp;lt;/math&amp;gt; – Entropy of set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; – The subsets created from splitting set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; by attribute &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;S = \bigcup_{t \in T} t&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;p(t)&amp;lt;/math&amp;gt; – The proportion of the number of elements in &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; to the number of elements in set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt;\Eta(t)&amp;lt;/math&amp;gt; – Entropy of subset &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In ID3, information gain can be calculated (instead of entropy) for each remaining attribute. The attribute with the &amp;#039;&amp;#039;&amp;#039;largest&amp;#039;&amp;#039;&amp;#039; information gain is used to split the set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; on this iteration.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Classification and regression tree]] (CART)&lt;br /&gt;
* [[C4.5 algorithm]]&lt;br /&gt;
*[[Decision tree learning]]&lt;br /&gt;
**[[Decision tree model]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
*{{Cite book|title=Machine Learning|url=https://archive.org/details/machinelearning00mitc_087|url-access=limited|last=Mitchell|first=Tom Michael|publisher=McGraw-Hill|year=1997|isbn=0070428077|location=New York, NY|pages=[https://archive.org/details/machinelearning00mitc_087/page/n66 55]–58|oclc=36417892}}&lt;br /&gt;
*{{Cite journal|last=Grzymala-Busse|first=Jerzy W.|date=February 1993|title=Selected Algorithms of Machine Learning from Examples|url=https://people.eecs.ku.edu/~jerzygb/j24-sel.pdf|journal=Fundamenta Informaticae|volume=18|issue=2|pages=193–207|via=ResearchGate}}&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* Seminars – [http://www2.cs.uregina.ca/~hamilton/courses/831/notes/ml/dtrees/4_dtrees1.html http://www2.cs.uregina.ca/]&lt;br /&gt;
* Description and examples – [http://www.cise.ufl.edu/~ddd/cap6635/Fall-97/Short-papers/2.htm http://www.cise.ufl.edu/]&lt;br /&gt;
* Description and examples – [http://www.cis.temple.edu/~ingargio/cis587/readings/id3-c45.html http://www.cis.temple.edu/]&lt;br /&gt;
*[http://jeremykun.com/2012/10/08/decision-trees-and-political-party-classification/ Decision Trees and Political Party Classification]&lt;br /&gt;
&lt;br /&gt;
[[Category:Decision trees]]&lt;br /&gt;
[[Category:Classification algorithms]]&lt;br /&gt;
[[Category:Articles with example pseudocode]]&lt;/div&gt;</summary>
		<author><name>imported&gt;BarFriedrich</name></author>
	</entry>
</feed>