<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Decisiontrees on davethehuman.com</title><link>https://davethehuman.com/tags/decisiontrees/</link><description>Recent content in Decisiontrees on davethehuman.com</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© 2026 Dave the human</copyright><lastBuildDate>Tue, 13 Oct 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://davethehuman.com/tags/decisiontrees/index.xml" rel="self" type="application/rss+xml"/><item><title>gini index</title><link>https://davethehuman.com/notes/gini-index/</link><pubDate>Tue, 13 Oct 2026 00:00:00 +0000</pubDate><guid>https://davethehuman.com/notes/gini-index/</guid><description>&lt;p&gt;&lt;em&gt;Gini Index&lt;/em&gt; or &lt;em&gt;Gini Impurity&lt;/em&gt; is a &lt;a href="https://davethehuman.com/coming-soon/" rel="nofollow"&gt;metric&lt;/a&gt; used to measure the frequency with which a randomly chosen element from a dataset would be incorrectly labeled if it were randomly labeled according to the distribution of labels in the subset.&lt;/p&gt;
&lt;p&gt;In Machine Learning, it is primarily used as a splitting criterion by the algorithm to build &lt;a href="https://davethehuman.com/coming-soon/" rel="nofollow"&gt;decision trees&lt;/a&gt;.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Formula
 &lt;div id="formula" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#formula" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h2&gt;
&lt;p&gt;The Formula For a dataset with $C$ total classes, where $p_i$ is the probability of an item belonging to class $i$: &lt;/p&gt;</description></item><item><title>entropy</title><link>https://davethehuman.com/notes/entropy/</link><pubDate>Sat, 10 Oct 2026 00:00:00 +0000</pubDate><guid>https://davethehuman.com/notes/entropy/</guid><description>&lt;p&gt;&lt;em&gt;Entropy&lt;/em&gt; is a statistics concept used to measure &lt;a href="https://davethehuman.com/coming-soon/" rel="nofollow"&gt;disorder&lt;/a&gt; in a sample.&lt;br&gt;
It is applied to calculate the &lt;a href="https://davethehuman.com/coming-soon/" rel="nofollow"&gt;information gain&lt;/a&gt; of a &lt;a href="https://davethehuman.com/coming-soon/" rel="nofollow"&gt;decision tree&lt;/a&gt;&amp;rsquo;s split through &lt;a href="https://davethehuman.com/coming-soon/" rel="nofollow"&gt;node impurity&lt;/a&gt;, and can be described with the formula:&lt;/p&gt;
$$
E = -\sum_{i=1}^{n} P(X) \log_2 P(X)
$$&lt;p&gt;
In a decision tree&amp;rsquo;s &lt;a href="https://davethehuman.com/coming-soon/" rel="nofollow"&gt;node&lt;/a&gt;, $P(X)$ is the number of times a given class has occurred in the node divided by the number of total examples $n$ in the node.&lt;br&gt;
It is basically the probability of encountering that class in the node&amp;rsquo;s sample. &lt;/p&gt;</description></item><item><title>Random Forest</title><link>https://davethehuman.com/notes/random-forest/</link><pubDate>Sat, 26 Sep 2026 00:00:00 +0000</pubDate><guid>https://davethehuman.com/notes/random-forest/</guid><description>&lt;p&gt;The &lt;em&gt;Random Forest&lt;/em&gt; is an &lt;a href="https://davethehuman.com/coming-soon/" rel="nofollow"&gt;ensemble&lt;/a&gt; of &lt;a href="https://davethehuman.com/coming-soon/" rel="nofollow"&gt;decision trees&lt;/a&gt; that reduces &lt;a href="https://davethehuman.com/coming-soon/" rel="nofollow"&gt;overfitting&lt;/a&gt; by using:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://davethehuman.com/coming-soon/" rel="nofollow"&gt;bagging&lt;/a&gt; to reduce &lt;a href="https://davethehuman.com/notes/variance-ml/"&gt;variance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;random selection of &lt;a href="https://davethehuman.com/coming-soon/" rel="nofollow"&gt;features&lt;/a&gt; from the full set of features at each &lt;a href="https://davethehuman.com/coming-soon/" rel="nofollow"&gt;split&lt;/a&gt; to prevent the important features from always being present at the top of each tree&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It is important to note that &lt;strong&gt;we can&amp;rsquo;t overfit by putting in too many trees&lt;/strong&gt; as they just reduce variance; at some point, variance reduction will just stop and we need to take into account computation time.&lt;/p&gt;</description></item></channel></rss>