<?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=Python-for-Machine-Learning%2FC2%2FLogistic-Regression-MultiClass-Classification%2FEnglish</id>
		<title>Python-for-Machine-Learning/C2/Logistic-Regression-MultiClass-Classification/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=Python-for-Machine-Learning%2FC2%2FLogistic-Regression-MultiClass-Classification%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Python-for-Machine-Learning/C2/Logistic-Regression-MultiClass-Classification/English&amp;action=history"/>
		<updated>2026-05-13T07:23:15Z</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=Python-for-Machine-Learning/C2/Logistic-Regression-MultiClass-Classification/English&amp;diff=57031&amp;oldid=prev</id>
		<title>Madhurig at 07:32, 11 July 2025</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Python-for-Machine-Learning/C2/Logistic-Regression-MultiClass-Classification/English&amp;diff=57031&amp;oldid=prev"/>
				<updated>2025-07-11T07:32:48Z</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 07:32, 11 July 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 45:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 45:&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;'''Iris flower classification'''&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;'''Iris flower classification'''&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;|| To implement the '''Multiclass classification model '''we will,&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;|| To implement the '''Multiclass classification model ''' we will,&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;* Use the '''iris '''dataset to classify the '''iris '''flower.&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;* Use the '''iris '''dataset to classify the '''iris '''flower.&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 know more about the '''iris''' dataset please watch earlier tutorials.&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 know more about the '''iris''' dataset please watch earlier tutorials.&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;|- &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;&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;|| Point to the '''LR_Multiclass.ipynb'''&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;|| Point to the '''LR_Multiclass.ipynb'''&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;|| '''LR_Multiclass dot ipynb '''is the ipython notebook file created for this demonstration.&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;|| '''LR_Multiclass dot ipynb ''' is the ipython notebook file created for this demonstration.&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;&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;|| Press '''Ctrl+Alt'''+'''T '''keys&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;|| Press '''Ctrl+Alt'''+'''T '''keys&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 58:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 58:&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;Press '''Enter'''&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;Press '''Enter'''&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: '''(ml)'''&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: '''(ml)'''&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 us open the Linux terminal by pressing '''Ctrl, Alt''' and '''T '''keys together.&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 us open the Linux terminal by pressing '''Ctrl, Alt''' and '''T ''' keys together.&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;Activate the machine learning environment as shown.&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;Activate the machine learning environment as shown.&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 76:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 76:&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;Double Click on '''LR_Multiclass.ipynb '''file&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;Double Click on '''LR_Multiclass.ipynb '''file&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;|| We can see the '''Jupyter Notebook&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;''' '''&lt;/del&gt;Home page''' has opened in the web browser.&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;|| We can see the '''Jupyter Notebook Home page''' has opened in the web browser.&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;Click on the''' LR underscore Multiclass dot ipynb '''file to open it.&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;Click on the''' LR underscore Multiclass dot ipynb '''file to open it.&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 266:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 266:&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 we have successfully classified different Iris flower classes.&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 we have successfully classified different Iris flower classes.&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;This brings us to the end of the tutorial&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;. Let us summarize&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;This brings us to the end of the tutorial. &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;|- &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;&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 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;'''Summary'''&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;'''Summary'''&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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;|| &lt;/del&gt;In this tutorial, we have learnt about* Multiclass Classification for Logistic Regression&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;&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;In this tutorial, we have learnt about&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;* Multiclass Classification for Logistic Regression&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 class=&quot;diffchange diffchange-inline&quot;&gt;|| Let us summarize.&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;|- &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;/table&gt;</summary>
		<author><name>Madhurig</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Python-for-Machine-Learning/C2/Logistic-Regression-MultiClass-Classification/English&amp;diff=57030&amp;oldid=prev</id>
		<title>Madhurig at 07:13, 11 July 2025</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Python-for-Machine-Learning/C2/Logistic-Regression-MultiClass-Classification/English&amp;diff=57030&amp;oldid=prev"/>
				<updated>2025-07-11T07:13:55Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://script.spoken-tutorial.org/index.php?title=Python-for-Machine-Learning/C2/Logistic-Regression-MultiClass-Classification/English&amp;amp;diff=57030&amp;amp;oldid=56996&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Madhurig</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Python-for-Machine-Learning/C2/Logistic-Regression-MultiClass-Classification/English&amp;diff=56996&amp;oldid=prev</id>
		<title>Nirmala Venkat: Created page with &quot;   &lt;div style=&quot;margin-left:1.27cm;margin-right:0cm;&quot;&gt;&lt;/div&gt; {| border=&quot;1&quot; |- || '''Visual Cue''' || '''Narration''' |- |- style=&quot;border:0.5pt solid #000000;padding-top:0cm;pad...&quot;</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Python-for-Machine-Learning/C2/Logistic-Regression-MultiClass-Classification/English&amp;diff=56996&amp;oldid=prev"/>
				<updated>2025-06-24T11:13:01Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;   &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt; {| border=&amp;quot;1&amp;quot; |- || &amp;#039;&amp;#039;&amp;#039;Visual Cue&amp;#039;&amp;#039;&amp;#039; || &amp;#039;&amp;#039;&amp;#039;Narration&amp;#039;&amp;#039;&amp;#039; |- |- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;pad...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|| '''Visual Cue'''&lt;br /&gt;
|| '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Show slide:&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Welcome'''&lt;br /&gt;
|| Welcome to the Spoken Tutorial on '''Logistic Regression - Multiclass Classification.'''&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&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;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Multiclass Classification for Logistic Regression&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Show slide:&lt;br /&gt;
&lt;br /&gt;
'''System Requirements'''&lt;br /&gt;
|| To record this tutorial, I am using&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''Ubuntu Linux '''OS version''' 24.04'''&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;'''Jupyter Notebook '''IDE&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Show slide: &lt;br /&gt;
&lt;br /&gt;
'''Prerequisite'''&lt;br /&gt;
|| To follow this tutorial,&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;The learner must have basic knowledge of '''Python.'''&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;For pre-requisite '''Python''' tutorials, please visit this website.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Show slide:&lt;br /&gt;
&lt;br /&gt;
'''Code files'''&lt;br /&gt;
|| &lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;The files used in this tutorial are provided in the '''Code files '''link.&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Please download and extract the files.&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Make a copy and then use them while practicing.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Show slide:&lt;br /&gt;
&lt;br /&gt;
'''Iris flower classification'''&lt;br /&gt;
|| To implement the '''Multiclass classification model '''we will,&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Use the '''iris '''dataset to classify the '''iris '''flower.&amp;lt;/div&amp;gt;&lt;br /&gt;
* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;To know more about the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''iris'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt; dataset please watch &amp;lt;/span&amp;gt;earlier &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;tutorials.&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Point to the '''LR_Multiclass.ipynb'''&lt;br /&gt;
|| '''LR_Multiclass dot ipynb '''is the ipython notebook file created for this demonstration.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Press '''Ctrl+Alt'''+'''T '''keys&lt;br /&gt;
&lt;br /&gt;
Type '''conda activate ml'''&lt;br /&gt;
Press '''Enter'''&lt;br /&gt;
Highlight: '''(ml)'''&lt;br /&gt;
|| Let us open the Linux terminal by pressing '''Ctrl, Alt''' and '''T '''keys together.&lt;br /&gt;
&lt;br /&gt;
Activate the machine learning environment as shown.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Type '''cd Downloads'''&lt;br /&gt;
&lt;br /&gt;
Type '''jupyter notebook'''&lt;br /&gt;
&lt;br /&gt;
Press '''Enter '''&lt;br /&gt;
|| I have saved my code file in the '''Downloads''' folder.&lt;br /&gt;
&lt;br /&gt;
Please navigate to the respective folder of your code file location.&lt;br /&gt;
&lt;br /&gt;
Then type, '''jupyter space notebook '''and press''' Enter.'''&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Show Jupyter Notebook Home page:&lt;br /&gt;
&lt;br /&gt;
Double Click on '''LR_Multiclass.ipynb '''file&lt;br /&gt;
|| We can see the '''Jupyter Notebook''' '''Home page''' has opened in the web browser.&lt;br /&gt;
&lt;br /&gt;
Click on the''' LR underscore Multiclass dot ipynb '''file to open it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Note that each cell will have the output displayed in this file.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us see the implementation of '''multiclass logistic regression'''.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight '''import pandas as pd '''&lt;br /&gt;
&lt;br /&gt;
|| These are the necessary libraries to be imported for '''Multiclass classification.'''&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Only narration&lt;br /&gt;
&lt;br /&gt;
Highlight: '''iris = load_iris()'''&lt;br /&gt;
&lt;br /&gt;
'''iris.data[:5]'''&lt;br /&gt;
|| We first load the Iris dataset using the '''load underscore iris''' method.&lt;br /&gt;
&lt;br /&gt;
The dataset is stored in the variable '''iris'''.&lt;br /&gt;
&lt;br /&gt;
Then we display the first five rows using the '''head''' method.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight '''Data Preprocessing'''&lt;br /&gt;
|| Now, let us prepare the data for training.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight&lt;br /&gt;
&lt;br /&gt;
'''X = iris.data '''&lt;br /&gt;
|| We create variable '''X''' and assign all feature columns to it.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight '''Y = iris.target''' &lt;br /&gt;
|| Next, we assign the target column to the variable '''Y'''.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight '''df = pd.DataFrame(X, columns=iris.feature_names)'''&lt;br /&gt;
&lt;br /&gt;
'''df['target'] = Y'''&lt;br /&gt;
|| To analyze the data better, we create a DataFrame '''df''' using '''pd dot DataFrame'''.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight '''corr_matrix = df[iris.feature_names].corr()'''&lt;br /&gt;
|| We compute '''correlation''' values between features of the '''Iris''' dataset using '''df dot corr'''.&lt;br /&gt;
&lt;br /&gt;
Now, we visualize this '''correlation''' using a '''heatmap'''.&lt;br /&gt;
&lt;br /&gt;
The '''heatmap''' shows how features relate to one another.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight '''Train and Test Split'''&lt;br /&gt;
|| Next, we split the data into training and testing sets.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight '''Model Instantiation of Multiclass Classification and Model training'''&lt;br /&gt;
|| Let us now build a multiclass classification model.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight '''mlr = LogisticRegression(multi_class='multinomial', solver='lbfgs', max_iter=1000) '''&lt;br /&gt;
&lt;br /&gt;
'''mlr.fit(X_train, Y_train)''' &lt;br /&gt;
|| We create an instance of '''LogisticRegression''' from the '''sklearn''' library.&lt;br /&gt;
&lt;br /&gt;
Set multi underscore class equals '''multinomial '''and solver equals '''lbfgs'''.&lt;br /&gt;
&lt;br /&gt;
We also set '''max underscore iter''' equals 1000 to ensure convergence.&lt;br /&gt;
&lt;br /&gt;
Now we train the model using the '''fit''' method on the '''training data'''.&lt;br /&gt;
&lt;br /&gt;
Ignore the warning in the output cell, if any.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight &lt;br /&gt;
&lt;br /&gt;
'''Y_train_pred = mlr.predict(X_train)'''&lt;br /&gt;
&lt;br /&gt;
|| Now, we calculate and print the '''training accuracy'''.&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Hightlight '''Training Accuracy: 0.981'''&lt;br /&gt;
|| The '''training accuracy''' is approximately '''0.981''', which is quite good.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight&lt;br /&gt;
&lt;br /&gt;
'''Train Log Loss: 0.1308'''&lt;br /&gt;
|| Next, we calculate the cross-entropy loss for the training data.&lt;br /&gt;
&lt;br /&gt;
A Loss of '''0.1308''' shows the model is making accurate predictions.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight&lt;br /&gt;
&lt;br /&gt;
'''plt.figure(figsize=(8, 6))'''&lt;br /&gt;
&lt;br /&gt;
'''for i in range(Y_train_pred_proba.shape[1]): &amp;lt;nowiki&amp;gt;# Iterate over each class&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''fpr, tpr, _ = roc_curve(Y_train == i, Y_train_pred_proba[:, i]) &amp;lt;nowiki&amp;gt;# One-vs-rest for each class&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''roc_auc = auc(fpr, tpr)'''&lt;br /&gt;
&lt;br /&gt;
|| Let us now plot the '''ROC curve''' and calculate the '''ROC-AUC score'''.&lt;br /&gt;
&lt;br /&gt;
The '''ROC curve''' shows '''TPR vs FPR''' at various threshold values.&lt;br /&gt;
&lt;br /&gt;
'''TPR''' stands for '''True Positive Rate''' that is '''recall'''. &lt;br /&gt;
&lt;br /&gt;
It is the fraction of actual positives correctly identified. &lt;br /&gt;
&lt;br /&gt;
'''FPR''' stands for''' False Positive Rate'''. &lt;br /&gt;
&lt;br /&gt;
It is the fraction of actual negatives wrongly classified as positives.&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Show output plot&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;The '''ROC curve''' shows near-perfect classification.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;The curves stay close to the '''top-left corner'''. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;All three classes achieve an '''AUC''' of '''1.00'''. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;This indicates the model effectively distinguishes the classes.&amp;lt;/div&amp;gt;&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight: '''Predictions for Test Data'''&lt;br /&gt;
|| Further, we predict labels for x underscore test.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight '''test_data = X_test[15].reshape(1, -1)'''&lt;br /&gt;
&lt;br /&gt;
'''predicted_class = mlr.predict(test_data)'''&lt;br /&gt;
|| We test the model on a single sample, similar to binary classification.&lt;br /&gt;
&lt;br /&gt;
We compare the predicted with the actual test class.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight: '''Predicted class: 0, Actual class: 0''' &lt;br /&gt;
|| The predicted value is 0, which is Setosa.&lt;br /&gt;
&lt;br /&gt;
The actual value is also 0, hence prediction is correct.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight '''Y_pred = mlr.predict(x_test)'''&lt;br /&gt;
|| '''y underscore pred '''stores predicted labels for all test samples.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight: '''print(&amp;quot;Multiclass classification - Actual vs Predicted:&amp;quot;)'''&lt;br /&gt;
|| We compare the actual class labels with the predicted labels.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight:''' Multiclass Logistic Regression - Actual vs Predicted:'''&lt;br /&gt;
|| The output shows both actual and predicted label arrays.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight: '''test_accuracy = accuracy_score(y_test, y_pred)'''&lt;br /&gt;
&lt;br /&gt;
'''print(f&amp;quot;Test Accuracy: {test_accuracy:.3f}&amp;quot;)'''&lt;br /&gt;
|| Now we calculate the '''test accuracy'''.&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight:''' Test Accuracy: 0.978'''&lt;br /&gt;
|| We get an accuracy of approximately '''0.978''', which is pretty good.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;nowiki&amp;gt;# Predict probabilities for test set&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''Y_test_pred_proba = mlr.predict_proba(X_test)'''&lt;br /&gt;
&lt;br /&gt;
|| We also compute '''ROC-AUC score''' and '''cross-entropy loss''' for test data.&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight&lt;br /&gt;
&lt;br /&gt;
'''Test ROC-AUC Score (OvR): 0.9968'''&lt;br /&gt;
&lt;br /&gt;
'''Test Log Loss: 0.1616'''&lt;br /&gt;
&lt;br /&gt;
|| '''ROC-AUC score''' of '''0.9968 '''indicates excellent performance.&lt;br /&gt;
&lt;br /&gt;
'''Cross-entropy loss''' of '''0.1616''' shows the predictions are accurate.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Highlight&lt;br /&gt;
&lt;br /&gt;
'''conf_matrix = confusion_matrix(Y_test, Y_pred) '''&lt;br /&gt;
&lt;br /&gt;
|| Let us visualize the '''confusion matrix''' of the model.&lt;br /&gt;
&lt;br /&gt;
It shows how well the model classifies each class.&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Show output plot&lt;br /&gt;
|| This matrix has three classes: 0, 1, and 2.&lt;br /&gt;
&lt;br /&gt;
The '''diagonal values''' represent correct predictions.&lt;br /&gt;
&lt;br /&gt;
One sample from Class 1 was incorrectly predicted as Class 2.&lt;br /&gt;
&lt;br /&gt;
The absence of other misclassified values indicates that the model performs well.&lt;br /&gt;
&lt;br /&gt;
A '''strong diagonal pattern''' suggests '''high classification accuracy'''.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Only narration&lt;br /&gt;
|| Now we have successfully classified different Iris flower classes.&lt;br /&gt;
&lt;br /&gt;
This brings us to the end of the tutorial. Let us summarize.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Show slide:&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
|| In this tutorial, we have learnt about* &amp;lt;div style=&amp;quot;margin-left:1.27cm;margin-right:0cm;&amp;quot;&amp;gt;Multiclass Classification for Logistic Regression&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Show slide: &lt;br /&gt;
&lt;br /&gt;
'''Assignment '''&lt;br /&gt;
|| As an assignment, please do the following:&lt;br /&gt;
* Generate the classification report of the model using '''sklearn''' method as shown.&lt;br /&gt;
* Use classification_report from sklearn dot metrics to display results.&lt;br /&gt;
* This shows '''precision''', '''recall''', '''f1-score''', and '''support''' for each class.&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| Show slide:&lt;br /&gt;
|| After completing the assignment, the output should match the expected result.&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Show Slide:&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''FOSSEE Forum'''&amp;lt;/div&amp;gt;&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;background-color:#ffffff;color:#000000;&amp;quot;&amp;gt;For any general or technical questions on &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Python for'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Machine Learning'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;background-color:#ffffff;color:#000000;&amp;quot;&amp;gt;, visit the&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;background-color:#ffffff;color:#000000;&amp;quot;&amp;gt;''' FOSSEE forum'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;background-color:#ffffff;color:#000000;&amp;quot;&amp;gt; and post your question.&amp;lt;/span&amp;gt;&lt;br /&gt;
|- style=&amp;quot;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;&amp;quot;&lt;br /&gt;
|| &amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Show Slide:&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Thank You'''&amp;lt;/div&amp;gt;&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;This is &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;'''Anvita Thadavoose Manjummel'''&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:#000000;&amp;quot;&amp;gt;, a FOSSEE Summer Fellow 2025, IIT Bombay signing off.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#000000;&amp;quot;&amp;gt;Thanks for joining.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nirmala Venkat</name></author>	</entry>

	</feed>