<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Machine-Learning-using-R%2FC3%2FBagging-in-R%2FEnglish</id>
		<title>Machine-Learning-using-R/C3/Bagging-in-R/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Machine-Learning-using-R%2FC3%2FBagging-in-R%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Machine-Learning-using-R/C3/Bagging-in-R/English&amp;action=history"/>
		<updated>2026-05-13T09:25:56Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Machine-Learning-using-R/C3/Bagging-in-R/English&amp;diff=56805&amp;oldid=prev</id>
		<title>Madhurig at 11:12, 27 January 2025</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Machine-Learning-using-R/C3/Bagging-in-R/English&amp;diff=56805&amp;oldid=prev"/>
				<updated>2025-01-27T11:12:38Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 11:12, 27 January 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Opening Slide'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Opening Slide'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Welcome to this Spoken Tutorial on '''Bagging in R&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;.&lt;/del&gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Welcome to this Spoken Tutorial on '''Bagging in R'''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||'''Show slide'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||'''Show slide'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 42:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 42:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''https://spoken-tutorial.org'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''https://spoken-tutorial.org'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| To follow this tutorial, the learner should know:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| To follow this tutorial, the learner should know:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Basic programming in '''R'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* &lt;/ins&gt;Basic programming in '''R'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Basics of '''Machine Learning'''. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* &lt;/ins&gt;Basics of '''Machine Learning'''. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If not, please access the relevant tutorials on this website.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If not, please access the relevant tutorials on this website.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 51:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 51:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Bootstrap aggregation (Bagging) '''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Bootstrap aggregation (Bagging) '''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Now let us learn about '''Bootstrap aggregation '''or '''Bagging'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Now let us learn about '''Bootstrap aggregation '''or '''Bagging'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Any classification model fitted across several training data subsets is desired to have consistent decision boundaries. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Any classification model fitted across several training data subsets is desired to have consistent decision boundaries. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Large variation in the decision boundaries indicate higher variability of the classification model.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Large variation in the decision boundaries indicate higher variability of the classification model.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Bagging is a commonly used ensemble technique to reduce this variation.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Bagging is a commonly used ensemble technique to reduce this variation.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* In Bagging, random subsets of the training data are repeatedly chosen to construct multiple classifiers.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* In Bagging, random subsets of the training data are repeatedly chosen to construct multiple classifiers.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The Bootstrap classifiers constructed from chosen subsets are then aggregated.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The Bootstrap classifiers constructed from chosen subsets are then aggregated.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* For bagging of the decision tree classifier, the aggregation is done by a majority vote of the class predicted by Bootstrap trees.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* For bagging of the decision tree classifier, the aggregation is done by a majority vote of the class predicted by Bootstrap trees.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 75:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 81:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Implementation of Bagging'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Implementation of Bagging'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Now we will perform '''Bagging of Decision Tree classifier '''on the '''Raisin''' dataset with two chosen variables.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Now we will perform '''Bagging of Decision Tree classifier ''' on the '''Raisin''' dataset with two chosen variables.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| '''Show slide '''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| '''Show slide '''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 82:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 88:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| For this tutorial, I will use a script file''' Bagging-Decision-Tree.R'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| For this tutorial, I will use a script file''' Bagging-Decision-Tree.R'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Raisin Dataset 'raisin.xlsx'&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;.&lt;/del&gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Raisin Dataset 'raisin.xlsx''''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Please download these files from the''' Code files''' link of this tutorial.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Please download these files from the''' Code files''' link of this tutorial.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 90:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 96:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| [Computer screen]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| [Computer screen]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Highlight '''Bagging-Decision-Tree.R''' and the folder &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Highlight '''Bagging-Decision-Tree.R''' and the folder&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| I have downloaded and moved these files to the '''Bagging '''folder.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| I have downloaded and moved these files to the '''Bagging '''folder.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 146:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 153:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Run these commands to import the '''raisin''' dataset and prepare it for model building.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Run these commands to import the '''raisin''' dataset and prepare it for model building.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Click on data in the Environment tab to load it in the Source &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Window&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Click on data in the Environment tab to load it in the Source &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;window&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| [RStudio]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| [RStudio]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 168:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 175:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||&amp;#160; Select and run the commands.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||&amp;#160; Select and run the commands.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The data sets will be shown in the Environment tab.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The data sets will be shown in the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;Environment&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/ins&gt;tab.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 181:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 188:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Bagging_model &amp;lt;- bagging(class ~ ., data = train_data, coob = TRUE, nbagg = 200,control = rpart.control(cp = 0.00001, xval = 10, maxdepth = 2))'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Bagging_model &amp;lt;- bagging(class ~ ., data = train_data, coob = TRUE, nbagg = 200,control = rpart.control(cp = 0.00001, xval = 10, maxdepth = 2))'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| '''bagging():''' The bagging() function is used to create a bagging ensemble model.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| '''bagging():''' The bagging() function is used to create a bagging ensemble model.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 197:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 205:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The '''rpart.control''' argument allows to set up the hyperparameters of the base classifier. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The '''rpart.control''' argument allows to set up the hyperparameters of the base classifier. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''cp '''denotes the complexity parameter which is set to 0.00001.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''cp ''' denotes the complexity parameter which is set to 0.00001.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Xval''' is the number of cross-validations which is set to 10. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Xval''' is the number of cross-validations which is set to 10. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Maxdepth '''is the maximum depth of any node of the final tree. It is limited to 2 in this case.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Maxdepth ''' is the maximum depth of any node of the final tree. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It is limited to 2 in this case.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Select and run the command to train the model.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Select and run the command to train the model.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 235:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 245:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Let&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'s &lt;/del&gt;now evaluate our model.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Let &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;us &lt;/ins&gt;now evaluate our model.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| [RStudio]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| [RStudio]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 369:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 379:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;theme_minimal()&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;theme_minimal()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||In the'''Source '''window type &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;thesecommands&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;||In the'''Source '''window type &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;these commands&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Highlight &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Highlight &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Madhurig</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Machine-Learning-using-R/C3/Bagging-in-R/English&amp;diff=56710&amp;oldid=prev</id>
		<title>Ushav: Created page with &quot;'''Title of the script''': Bagging Algorithm for Decision Tree using R  '''Author''': Debatosh Chakraboty and YATE ASSEKE RONALD RONALD.  '''Keywords''': R, RStudio, Bagging A...&quot;</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Machine-Learning-using-R/C3/Bagging-in-R/English&amp;diff=56710&amp;oldid=prev"/>
				<updated>2024-11-27T06:18:17Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;Title of the script&amp;#039;&amp;#039;&amp;#039;: Bagging Algorithm for Decision Tree using R  &amp;#039;&amp;#039;&amp;#039;Author&amp;#039;&amp;#039;&amp;#039;: Debatosh Chakraboty and YATE ASSEKE RONALD RONALD.  &amp;#039;&amp;#039;&amp;#039;Keywords&amp;#039;&amp;#039;&amp;#039;: R, RStudio, Bagging A...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Title of the script''': Bagging Algorithm for Decision Tree using R&lt;br /&gt;
&lt;br /&gt;
'''Author''': Debatosh Chakraboty and YATE ASSEKE RONALD RONALD.&lt;br /&gt;
&lt;br /&gt;
'''Keywords''': R, RStudio, Bagging Algorithm, machine learning, supervised, unsupervised, dataset, video tutorial.&lt;br /&gt;
&lt;br /&gt;
{|border=1&lt;br /&gt;
|-&lt;br /&gt;
|| '''Visual Cue'''&lt;br /&gt;
|| '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|| '''Show slide'''&lt;br /&gt;
&lt;br /&gt;
'''Opening Slide'''&lt;br /&gt;
|| Welcome to this Spoken Tutorial on '''Bagging in R.'''&lt;br /&gt;
|-&lt;br /&gt;
||'''Show slide'''&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
|| In this tutorial, we will learn about: &lt;br /&gt;
* Bagging.&lt;br /&gt;
* Assumptions for Bagging.&lt;br /&gt;
* Advantages of Bagging.&lt;br /&gt;
* Implementation of Bagging using Decision Tree in R. &lt;br /&gt;
* Model Evaluation.&lt;br /&gt;
* Limitations of Bagging.&lt;br /&gt;
|-&lt;br /&gt;
||'''Show slide'''&lt;br /&gt;
&lt;br /&gt;
'''System Specifications'''&lt;br /&gt;
|| This tutorial is recorded using,&lt;br /&gt;
* '''Windows 11 '''&lt;br /&gt;
* '''R '''version''' 4.3.0'''&lt;br /&gt;
* '''RStudio''' version '''2023.06.1'''&lt;br /&gt;
&lt;br /&gt;
It is recommended to install '''R''' version '''4.2.0''' or higher. &lt;br /&gt;
|-&lt;br /&gt;
||'''Show slide'''&lt;br /&gt;
&lt;br /&gt;
'''Prerequisites '''&lt;br /&gt;
&lt;br /&gt;
'''https://spoken-tutorial.org'''&lt;br /&gt;
|| To follow this tutorial, the learner should know:&lt;br /&gt;
Basic programming in '''R'''.&lt;br /&gt;
Basics of '''Machine Learning'''. &lt;br /&gt;
&lt;br /&gt;
If not, please access the relevant tutorials on this website.&lt;br /&gt;
|-&lt;br /&gt;
|| '''Show slide'''&lt;br /&gt;
&lt;br /&gt;
'''Bootstrap aggregation (Bagging) '''&lt;br /&gt;
|| Now let us learn about '''Bootstrap aggregation '''or '''Bagging'''.&lt;br /&gt;
* Any classification model fitted across several training data subsets is desired to have consistent decision boundaries. &lt;br /&gt;
* Large variation in the decision boundaries indicate higher variability of the classification model.&lt;br /&gt;
* Bagging is a commonly used ensemble technique to reduce this variation.&lt;br /&gt;
* In Bagging, random subsets of the training data are repeatedly chosen to construct multiple classifiers.&lt;br /&gt;
* The Bootstrap classifiers constructed from chosen subsets are then aggregated.&lt;br /&gt;
* For bagging of the decision tree classifier, the aggregation is done by a majority vote of the class predicted by Bootstrap trees.&lt;br /&gt;
|-&lt;br /&gt;
|| '''Show slide'''&lt;br /&gt;
&lt;br /&gt;
'''Assumptions of Bagging'''&lt;br /&gt;
* Each observation is independent.&lt;br /&gt;
* The assumption of the chosen classifier is satisfied.&lt;br /&gt;
|| Primarily, the assumptions of the chosen classifier must be satisfied for bagging.&lt;br /&gt;
|-&lt;br /&gt;
|| '''Show slide'''&lt;br /&gt;
&lt;br /&gt;
'''Advantages of Bagging'''&lt;br /&gt;
|| Advantages of Bagging include:&lt;br /&gt;
* Bagging reduces the variation of the chosen model.&lt;br /&gt;
* Bagging improves the performance (accuracy) of the decision tree classifier in general.&lt;br /&gt;
|-&lt;br /&gt;
|| '''Show slide'''&lt;br /&gt;
&lt;br /&gt;
'''Implementation of Bagging'''&lt;br /&gt;
|| Now we will perform '''Bagging of Decision Tree classifier '''on the '''Raisin''' dataset with two chosen variables.&lt;br /&gt;
|-&lt;br /&gt;
|| '''Show slide '''&lt;br /&gt;
&lt;br /&gt;
'''Download Files'''&lt;br /&gt;
|| For this tutorial, I will use a script file''' Bagging-Decision-Tree.R'''.&lt;br /&gt;
&lt;br /&gt;
'''Raisin Dataset 'raisin.xlsx'.'''&lt;br /&gt;
&lt;br /&gt;
Please download these files from the''' Code files''' link of this tutorial.&lt;br /&gt;
&lt;br /&gt;
Make a copy and then use them while practicing.&lt;br /&gt;
|-&lt;br /&gt;
|| [Computer screen]&lt;br /&gt;
&lt;br /&gt;
Highlight '''Bagging-Decision-Tree.R''' and the folder &lt;br /&gt;
|| I have downloaded and moved these files to the '''Bagging '''folder.&lt;br /&gt;
&lt;br /&gt;
The '''Bagging''' folder is in the '''MLProject''' folder .&lt;br /&gt;
&lt;br /&gt;
I have also set the '''Bagging''' folder as my working Directory.&lt;br /&gt;
|-&lt;br /&gt;
|| &lt;br /&gt;
|| Let us switch to '''RStudio'''. &lt;br /&gt;
|-&lt;br /&gt;
|| Double click '''Bagging-Decision-Tree.R''' in RStudio&lt;br /&gt;
&lt;br /&gt;
Point to '''Bagging-Decision-Tree.R''' in RStudio.&lt;br /&gt;
|| Open the script '''Bagging-Decision-Tree.R'''. in '''RStudio'''.&lt;br /&gt;
&lt;br /&gt;
Script '''Bagging-Decision-Tree.R''' opens in '''RStudio'''.&lt;br /&gt;
|-&lt;br /&gt;
|| [RStudio]&lt;br /&gt;
&lt;br /&gt;
'''library(readxl)'''&lt;br /&gt;
&lt;br /&gt;
'''library(ipred)'''&lt;br /&gt;
&lt;br /&gt;
'''library(caret)'''&lt;br /&gt;
&lt;br /&gt;
'''library(cvms)'''&lt;br /&gt;
&lt;br /&gt;
'''library(rpart)'''&lt;br /&gt;
||  Select and run these commands to import the necessary packages.&lt;br /&gt;
|-&lt;br /&gt;
|| [RStudio]&lt;br /&gt;
&lt;br /&gt;
Highlight '''library(ipred)'''&lt;br /&gt;
&lt;br /&gt;
Highlight''' library(rpart)'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''library(cvms)'''&lt;br /&gt;
||  The''' ipred '''library contains the '''bagging()''' function.&lt;br /&gt;
&lt;br /&gt;
The '''rpart '''library will be used to implement the decision tree model for bagging.&lt;br /&gt;
&lt;br /&gt;
We will use the '''cvms''' package for plotting the confusion matrix.&lt;br /&gt;
&lt;br /&gt;
As I have already installed these packages.&lt;br /&gt;
&lt;br /&gt;
I have directly imported them. &lt;br /&gt;
|-&lt;br /&gt;
|| Highlight''' '''&lt;br /&gt;
&lt;br /&gt;
'''data &amp;lt;- read_xlsx(&amp;quot;Raisin.xlsx&amp;quot;)'''&lt;br /&gt;
&lt;br /&gt;
'''data&amp;lt;-data[c(&amp;quot;minorAL&amp;quot;,&amp;quot;ecc&amp;quot;,&amp;quot;class&amp;quot;)]'''&lt;br /&gt;
&lt;br /&gt;
'''data$class &amp;lt;- factor(data$class)'''&lt;br /&gt;
|| Run these commands to import the '''raisin''' dataset and prepare it for model building.&lt;br /&gt;
&lt;br /&gt;
Click on data in the Environment tab to load it in the Source Window&lt;br /&gt;
|-&lt;br /&gt;
|| [RStudio]&lt;br /&gt;
&lt;br /&gt;
'''set.seed(1) '''&lt;br /&gt;
&lt;br /&gt;
'''index_split=sample(1:nrow(data),size=0.7*nrow(data),replace=FALSE)'''&lt;br /&gt;
&lt;br /&gt;
'''train_data &amp;lt;- data[index_split, ]'''&lt;br /&gt;
&lt;br /&gt;
'''test_data &amp;lt;- data[-c(index_split), ]'''&lt;br /&gt;
|| Type these commands in the source window to perform the train-test split&lt;br /&gt;
|-&lt;br /&gt;
|| Highlight '''set.seed(1)'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''sample(1:nrow(data),size=0.7*nrow(data),replace=FALSE)'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''replace=FALSE'''&lt;br /&gt;
&lt;br /&gt;
Select the commands and click the Run button.&lt;br /&gt;
||  Select and run the commands.&lt;br /&gt;
&lt;br /&gt;
The data sets will be shown in the Environment tab.&lt;br /&gt;
|-&lt;br /&gt;
|| &lt;br /&gt;
|| Let us now create our '''Bagging''' model.&lt;br /&gt;
|-&lt;br /&gt;
|| [RStudio]&lt;br /&gt;
&lt;br /&gt;
'''bagging_model &amp;lt;- bagging(class ~ ., data = train_data, coob = TRUE, nbagg = 200,control = rpart.control(cp = 0.00001, xval = 10, maxdepth = 2))'''&lt;br /&gt;
||  In the source window type these commands.&lt;br /&gt;
|-&lt;br /&gt;
|| Highlight &lt;br /&gt;
&lt;br /&gt;
'''Bagging_model &amp;lt;- bagging(class ~ ., data = train_data, coob = TRUE, nbagg = 200,control = rpart.control(cp = 0.00001, xval = 10, maxdepth = 2))'''&lt;br /&gt;
|| '''bagging():''' The bagging() function is used to create a bagging ensemble model.&lt;br /&gt;
&lt;br /&gt;
'''class ~''' .: This formula indicates that the model should predict the 'class' variable.&lt;br /&gt;
&lt;br /&gt;
It uses all other variables in the train_data as predictors.&lt;br /&gt;
&lt;br /&gt;
'''data:''' The dataset used for building the model, is specified as train_data.&lt;br /&gt;
&lt;br /&gt;
'''coob:''' When '''coob''' is TRUE, it indicates out-of-bag (OOB) error estimate. &lt;br /&gt;
&lt;br /&gt;
OOB error is a technique to measure the error of the generated bootstrap classifiers.&lt;br /&gt;
&lt;br /&gt;
'''nbagg:''' Sets the number of bootstrap replicates for bagging. It is set to 200 in this case.&lt;br /&gt;
&lt;br /&gt;
The '''rpart.control''' argument allows to set up the hyperparameters of the base classifier. &lt;br /&gt;
&lt;br /&gt;
'''cp '''denotes the complexity parameter which is set to 0.00001.&lt;br /&gt;
&lt;br /&gt;
'''Xval''' is the number of cross-validations which is set to 10. &lt;br /&gt;
&lt;br /&gt;
'''Maxdepth '''is the maximum depth of any node of the final tree. It is limited to 2 in this case.&lt;br /&gt;
&lt;br /&gt;
Select and run the command to train the model.&lt;br /&gt;
|-&lt;br /&gt;
|| '''print(bagging_model)'''&lt;br /&gt;
|| In the '''Source''' window type and run this command.&lt;br /&gt;
|-&lt;br /&gt;
|| Point to the console window.&lt;br /&gt;
|| The output is shown in the console window.&lt;br /&gt;
&lt;br /&gt;
Drag boundary to see the console window clearly.&lt;br /&gt;
|-&lt;br /&gt;
||  Highlight&lt;br /&gt;
&lt;br /&gt;
'''Out-of-bag estimate of misclassification error: 0.1746'''&lt;br /&gt;
|| We can confirm that our model is trained successfully.&lt;br /&gt;
&lt;br /&gt;
The training misclassification error of the model is 0.1746.&lt;br /&gt;
|-&lt;br /&gt;
|| [RStudio]&lt;br /&gt;
&lt;br /&gt;
'''predictions &amp;lt;- predict(bagging_model, newdata = test_data, type = &amp;quot;class&amp;quot;)'''&lt;br /&gt;
|| Let us now use our model for prediction.&lt;br /&gt;
&lt;br /&gt;
In the source window type and run the command&lt;br /&gt;
|-&lt;br /&gt;
|| Highlight &lt;br /&gt;
&lt;br /&gt;
'''predictions &amp;lt;- predict(bagging_model, newdata = test_data, type = &amp;quot;class&amp;quot;)'''&lt;br /&gt;
&lt;br /&gt;
Click on '''Save''' and '''Run '''buttons.&lt;br /&gt;
|| This command stores the prediction of the model bagging_model on test data in a variable '''predictions'''. &lt;br /&gt;
|-&lt;br /&gt;
|| &lt;br /&gt;
|| Let's now evaluate our model.&lt;br /&gt;
|-&lt;br /&gt;
|| [RStudio]&lt;br /&gt;
&lt;br /&gt;
'''confusion_matrix &amp;lt;- confusionMatrix(predictions, test_data$class)'''&lt;br /&gt;
|| Type this command in the''' Source''' window&lt;br /&gt;
|-&lt;br /&gt;
|| Highlight &lt;br /&gt;
&lt;br /&gt;
'''confusion_matrix &amp;lt;- confusionMatrix(predictions, test$class)'''&lt;br /&gt;
|| This command will create a confusion matrix list.&lt;br /&gt;
&lt;br /&gt;
The list will contain the different evaluation metrics.&lt;br /&gt;
&lt;br /&gt;
Select and run the command&lt;br /&gt;
|-&lt;br /&gt;
|| [RStudio]&lt;br /&gt;
&lt;br /&gt;
'''confusion_matrix$overall[&amp;quot;Accuracy&amp;quot;]'''&lt;br /&gt;
|| Now, let us type this command.&lt;br /&gt;
&lt;br /&gt;
This command will display the accuracy of the model.&lt;br /&gt;
&lt;br /&gt;
It retrieves it from the confusion Matrix list created.&lt;br /&gt;
&lt;br /&gt;
Select and run the command&lt;br /&gt;
|-&lt;br /&gt;
|| '''Highlight '''0.8407&lt;br /&gt;
|| We can see that our model has 84 percent accuracy&lt;br /&gt;
&lt;br /&gt;
Note that we can achieve higher accuracy by not manually specifying the max-depth attribute.&lt;br /&gt;
|-&lt;br /&gt;
|| '''confusion_table &amp;lt;- data.frame(confusion_matrix$table)'''&lt;br /&gt;
|| In the source window, type this command.&lt;br /&gt;
&lt;br /&gt;
This will create a data-frame of the confusion matrix table.&lt;br /&gt;
&lt;br /&gt;
Select and run the command.&lt;br /&gt;
&lt;br /&gt;
Click on confusion_table in the Environment tab.&lt;br /&gt;
&lt;br /&gt;
Notice that it displays the number of correct and incorrect predictions for each class.&lt;br /&gt;
|-&lt;br /&gt;
|| Cursor in the source window.&lt;br /&gt;
|| In the source window, type these commands to plot the confusion matrix&lt;br /&gt;
|-&lt;br /&gt;
|| '''plot_confusion_matrix(confusion_table, '''&lt;br /&gt;
&lt;br /&gt;
'''target_col = &amp;quot;Reference&amp;quot;,'''&lt;br /&gt;
&lt;br /&gt;
'''prediction_col = &amp;quot;Prediction&amp;quot;,'''&lt;br /&gt;
&lt;br /&gt;
'''counts_col = &amp;quot;Freq&amp;quot;,'''&lt;br /&gt;
&lt;br /&gt;
'''palette = list(&amp;quot;low&amp;quot; = &amp;quot;pink1&amp;quot;,&amp;quot;high&amp;quot; = &amp;quot;green1&amp;quot;),'''&lt;br /&gt;
&lt;br /&gt;
'''add_normalized = FALSE,'''&lt;br /&gt;
&lt;br /&gt;
'''add_row_percentages = FALSE,'''&lt;br /&gt;
&lt;br /&gt;
'''add_col_percentages = FALSE)'''&lt;br /&gt;
|| We use the '''plot_confusion_matrix '''function from the''' cvms '''package.&lt;br /&gt;
&lt;br /&gt;
We will use the created data frame '''confusion_table'''.&lt;br /&gt;
&lt;br /&gt;
'''Target_col '''is the column in the dataframe with the labels for reference.&lt;br /&gt;
&lt;br /&gt;
'''Prediction_col '''is the column in the dataframe with predicted labels.&lt;br /&gt;
&lt;br /&gt;
'''Counts_col''' is the column in the dataframe with the number of correct and incorrect labels.&lt;br /&gt;
&lt;br /&gt;
The palette will plot the correct and incorrect predictions in different colours. &lt;br /&gt;
&lt;br /&gt;
Select and run the commands&lt;br /&gt;
&lt;br /&gt;
The output is seen in the plot window&lt;br /&gt;
|-&lt;br /&gt;
|| Highlight output in '''plot window'''&lt;br /&gt;
|| 24 '''Besni''' samples have been incorrectly classified.&lt;br /&gt;
&lt;br /&gt;
19 '''Kecimen''' samples have been incorrectly classified. &lt;br /&gt;
&lt;br /&gt;
Overall, the model has misclassified only 43 samples.&lt;br /&gt;
|-&lt;br /&gt;
|| &lt;br /&gt;
|| Let us plot our model decision boundary.&lt;br /&gt;
|-&lt;br /&gt;
|| [RStudio]&lt;br /&gt;
&lt;br /&gt;
'''grid &amp;lt;- expand.grid(minorAL = seq(min(data$minorAL), max(data$minorAL), length = 200),'''&lt;br /&gt;
&lt;br /&gt;
'''ecc = seq(min(data$ecc), max(data$ecc), length = 200)) '''&lt;br /&gt;
&lt;br /&gt;
'''grid$class = predict(bagging_model, newdata = grid, type = &amp;quot;class&amp;quot;)'''&lt;br /&gt;
&lt;br /&gt;
'''grid$classnum &amp;lt;- as.numeric(grid$class)'''&lt;br /&gt;
||  In the '''Source''' window type these commands&lt;br /&gt;
|-&lt;br /&gt;
|| Highlight &lt;br /&gt;
&lt;br /&gt;
'''grid &amp;lt;- expand.grid(minorAL = seq(min(data$minorAL), max(data$minorAL), length = 200),'''&lt;br /&gt;
&lt;br /&gt;
'''ecc = seq(min(data$ecc), max(data$ecc), length = 200)) '''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;nowiki&amp;gt;# Predict classes&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''grid$class = predict(bagging_model, newdata = grid, type = &amp;quot;class&amp;quot;)'''&lt;br /&gt;
&lt;br /&gt;
'''grid$classnum &amp;lt;- as.numeric(grid$class)'''&lt;br /&gt;
||  This code first creates a '''grid '''of points spanning the feature space.&lt;br /&gt;
&lt;br /&gt;
The '''Bagging '''model then predicts the class of each point in this grid.&lt;br /&gt;
&lt;br /&gt;
Select and run the commands&lt;br /&gt;
|-&lt;br /&gt;
|| [RStudio]&lt;br /&gt;
&lt;br /&gt;
ggplot() +&lt;br /&gt;
&lt;br /&gt;
geom_raster(data = grid, aes(x = minorAL, y = ecc, fill = class), alpha = 0.4) +&lt;br /&gt;
&lt;br /&gt;
geom_point(data = train_data, aes(x = minorAL, y = ecc, color = class)) +&lt;br /&gt;
&lt;br /&gt;
geom_contour(data = grid, aes(x = minorAL, y = ecc, z = classnum),&lt;br /&gt;
&lt;br /&gt;
colour = &amp;quot;black&amp;quot;, linewidth = 0.7) +&lt;br /&gt;
&lt;br /&gt;
scale_fill_manual(values = c(&amp;quot;#ffff46&amp;quot;, &amp;quot;#FF46e9&amp;quot;)) +&lt;br /&gt;
&lt;br /&gt;
scale_color_manual(values = c(&amp;quot;red&amp;quot;, &amp;quot;blue&amp;quot;)) +&lt;br /&gt;
&lt;br /&gt;
labs(x = &amp;quot;MinorAL&amp;quot;, y = &amp;quot;ecc&amp;quot;, title = &amp;quot;Decision Boundary of Bootstrap Bagging&amp;quot;) +&lt;br /&gt;
&lt;br /&gt;
theme_minimal()&lt;br /&gt;
||In the'''Source '''window type thesecommands&lt;br /&gt;
|-&lt;br /&gt;
|| Highlight &lt;br /&gt;
&lt;br /&gt;
'''ggplot() +'''&lt;br /&gt;
&lt;br /&gt;
'''geom_raster(data = grid, aes(x = minorAL, y = ecc, fill = class), alpha = 0.4) +'''&lt;br /&gt;
&lt;br /&gt;
'''geom_point(data = train_data, aes(x = minorAL, y = ecc, color = class)) +'''&lt;br /&gt;
&lt;br /&gt;
'''geom_contour(data = grid, aes(x = minorAL, y = ecc, z = classnum),'''&lt;br /&gt;
&lt;br /&gt;
'''colour = &amp;quot;black&amp;quot;, linewidth = 0.7) +'''&lt;br /&gt;
&lt;br /&gt;
'''scale_fill_manual(values = c(&amp;quot;#ffff46&amp;quot;, &amp;quot;#FF46e9&amp;quot;)) +'''&lt;br /&gt;
&lt;br /&gt;
'''scale_color_manual(values = c(&amp;quot;red&amp;quot;, &amp;quot;blue&amp;quot;)) +'''&lt;br /&gt;
&lt;br /&gt;
'''labs(x = &amp;quot;MinorAL&amp;quot;, y = &amp;quot;ecc&amp;quot;, title = &amp;quot;Decision Boundary of Bootstrap Bagging&amp;quot;) +'''&lt;br /&gt;
&lt;br /&gt;
'''theme_minimal()'''&lt;br /&gt;
|| We plot the decision boundary using predicted classes of the grid.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
This command creates decision boundary and distribution of data points with colors indicating the predicted classes.&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Select and run the command.&lt;br /&gt;
|-&lt;br /&gt;
|| Drag boundaries.&lt;br /&gt;
|| Drag boundaries to see the plot window clearly.&lt;br /&gt;
|-&lt;br /&gt;
|| Highlight output in plot window&lt;br /&gt;
|| We observe that the model has separated most of the data points clearly.&lt;br /&gt;
&lt;br /&gt;
Note that after applying bagging to the decision tree classifier, the decision boundary looks similar to that of the decision tree.&lt;br /&gt;
&lt;br /&gt;
But it is more robust and complicated.&lt;br /&gt;
|-&lt;br /&gt;
|| '''Limitations of Bagging'''&lt;br /&gt;
* Bagging is hard to interpret.&lt;br /&gt;
* Requires more computational time.&lt;br /&gt;
* Bagging doesn’t improve model bias.&lt;br /&gt;
|| These are the limitations of Bagging.&lt;br /&gt;
|-&lt;br /&gt;
|| Only Narration&lt;br /&gt;
|| With this we come to the end of this tutorial. &lt;br /&gt;
&lt;br /&gt;
Let us summarize. &lt;br /&gt;
|-&lt;br /&gt;
|| '''Show Slide'''&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
|| In this tutorial we have learnt about:&lt;br /&gt;
* Bagging &lt;br /&gt;
* Assumptions for Bagging&lt;br /&gt;
* Advantages of Bagging&lt;br /&gt;
* Implementation of Bagging using Decision Tree in R &lt;br /&gt;
* Model Evaluation&lt;br /&gt;
* Limitations of Bagging&lt;br /&gt;
|-&lt;br /&gt;
|| &lt;br /&gt;
|| Now we will suggest the assignment for this Spoken Tutorial.&lt;br /&gt;
|-&lt;br /&gt;
|| '''Show Slide'''&lt;br /&gt;
&lt;br /&gt;
'''Assignment'''&lt;br /&gt;
|| &lt;br /&gt;
* Apply Bagging using Decision Tree on '''PimaIndiansDiabetes''' dataset &lt;br /&gt;
* Install the '''pdp''' package and import the dataset using the '''data(pima)''' command&lt;br /&gt;
* Visualize the decision boundary and measure the accuracy of the model&lt;br /&gt;
|- &lt;br /&gt;
|| '''Show slide'''&lt;br /&gt;
&lt;br /&gt;
'''About the Spoken Tutorial Project'''&lt;br /&gt;
|| The video at the following link summarizes the Spoken Tutorial project. &lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|- &lt;br /&gt;
|| '''Show slide'''&lt;br /&gt;
&lt;br /&gt;
'''Spoken Tutorial Workshops'''&lt;br /&gt;
|| We conduct workshops using Spoken Tutorials and give certificates.&lt;br /&gt;
&lt;br /&gt;
Please contact us.&lt;br /&gt;
|- &lt;br /&gt;
|| '''Show Slide'''&lt;br /&gt;
&lt;br /&gt;
Spoken Tutorial Forum to answer questions&lt;br /&gt;
&lt;br /&gt;
Do you have questions in THIS Spoken Tutorial?&lt;br /&gt;
&lt;br /&gt;
Choose the minute and second where you have the question.&lt;br /&gt;
&lt;br /&gt;
Explain your question briefly.&lt;br /&gt;
&lt;br /&gt;
Someone from the FOSSEE team will answer them.&lt;br /&gt;
&lt;br /&gt;
Please visit this site.&lt;br /&gt;
|| Please post your time queries in this forum.&lt;br /&gt;
|- &lt;br /&gt;
|| '''Show Slide'''&lt;br /&gt;
&lt;br /&gt;
'''Forum to answer questions'''&lt;br /&gt;
|| Do you have any general/technical questions?&lt;br /&gt;
&lt;br /&gt;
Please visit the forum given in the link.&lt;br /&gt;
|- &lt;br /&gt;
||  '''Show Slide'''&lt;br /&gt;
&lt;br /&gt;
'''Textbook Companion'''&lt;br /&gt;
|| The FOSSEE team coordinates the coding of solved examples of popular books and case study projects.&lt;br /&gt;
&lt;br /&gt;
We give certificates to those who do this.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit these sites.&lt;br /&gt;
|- &lt;br /&gt;
|| '''Show Slide'''&lt;br /&gt;
&lt;br /&gt;
'''Acknowledgment'''&lt;br /&gt;
|| The '''Spoken Tutorial''' was established by the Ministry of Education Govt of India.&lt;br /&gt;
|- &lt;br /&gt;
|| '''Show Slide'''&lt;br /&gt;
&lt;br /&gt;
Thank You&lt;br /&gt;
||This tutorial is contributed by Debatosh Chakraborty and Yate Asseke Ronald O from IIT Bombay.&lt;br /&gt;
&lt;br /&gt;
Thank you for joining.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Ushav</name></author>	</entry>

	</feed>