<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Machine Learning on Mr. Pointing</title>
    <link>https://mrpointing.com/notes/computer-science/python/machine-learning/</link>
    <description>Recent content in Machine Learning on Mr. Pointing</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>&lt;a href=&#34;https://creativecommons.org/licenses/by-nc/4.0/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;CC BY-NC 4.0&lt;/a&gt;</copyright>
    <lastBuildDate>Sat, 29 Nov 2025 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://mrpointing.com/notes/computer-science/python/machine-learning/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Support Vector Machines</title>
      <link>https://mrpointing.com/notes/computer-science/python/machine-learning/support-vector-machines/</link>
      <pubDate>Sat, 29 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://mrpointing.com/notes/computer-science/python/machine-learning/support-vector-machines/</guid>
      <description>&lt;hr&gt;&#xA;&lt;p&gt;For the theory and more detail on how this model works, go back to &lt;a href=&#34;https://mrpointing.com/notes/computer-science/textbooks/how-ai-works/how-ai-works---chapter-3/&#34;&gt;How AI Works - Chapter 3&lt;/a&gt; to freshen up. We only have two concepts to go over before we jump into the code.&lt;/p&gt;&#xA;&lt;p&gt;One concept not touched on in the text is the concept of &lt;strong&gt;Gamma&lt;/strong&gt;. Gamma is a metric that can high or low; the more gamma you have, the less input values you consider when drawing the boundary between points. Usually what you&amp;rsquo;ll have is high gamma approaches having a very loose boundary that follows the flow of your points, while a low gamma approach will have a more rigid approach that might even miss-label some points.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Decision Trees</title>
      <link>https://mrpointing.com/notes/computer-science/python/machine-learning/decision-trees/</link>
      <pubDate>Wed, 19 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://mrpointing.com/notes/computer-science/python/machine-learning/decision-trees/</guid>
      <description>&lt;hr&gt;&#xA;&lt;p&gt;Time to start tackling some of the models we discussed in &lt;a href=&#34;https://mrpointing.com/notes/computer-science/textbooks/how-ai-works/how-ai-works---chapter-3/&#34;&gt;How AI Works - Chapter 3&lt;/a&gt;. We&amp;rsquo;re going to do this out of order- we&amp;rsquo;ll come back to KNN another day. For now, we can start by building our first &lt;em&gt;Decision Tree&lt;/em&gt;. I&amp;rsquo;m not going to go into too much detail in this note, since we go over it in more detail in the note just above. Instead, let&amp;rsquo;s work through the Python code together so we can begin working on our exercise.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Logistic Regression</title>
      <link>https://mrpointing.com/notes/computer-science/python/machine-learning/logistic-regression/</link>
      <pubDate>Wed, 05 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://mrpointing.com/notes/computer-science/python/machine-learning/logistic-regression/</guid>
      <description>&lt;hr&gt;&#xA;&lt;h1 id=&#34;binary-classification&#34;&gt;Binary Classification&lt;/h1&gt;&#xA;&lt;p&gt;Another regression-type model I see. &amp;ldquo;How does this one differ from Linear Regression?&amp;rdquo; one might ask, and to them I would respond with the type of data we&amp;rsquo;re looking at. So far, all of the data we&amp;rsquo;ve used has given us a numerical output, &lt;em&gt;quantitative data&lt;/em&gt;. We want to predict the price of something in 10 years, or figure out how much a property will cost after a given period of time. We can call these predicted values &lt;em&gt;continuous&lt;/em&gt;. This time, what we&amp;rsquo;re going to want a response of a &lt;em&gt;categorical&lt;/em&gt; type.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Splitting Training and Testing Data</title>
      <link>https://mrpointing.com/notes/computer-science/python/machine-learning/splitting-training-and-testing-data/</link>
      <pubDate>Wed, 05 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://mrpointing.com/notes/computer-science/python/machine-learning/splitting-training-and-testing-data/</guid>
      <description>&lt;hr&gt;&#xA;&lt;p&gt;As we know from our &lt;a href=&#34;https://mrpointing.com/notes/computer-science/textbooks/how-ai-works/how-ai-works---chapter-2/&#34;&gt;previous lessons&lt;/a&gt;, we should split our data into two types; training and testing. So far, we&amp;rsquo;ve just been using all of our data when making our models. Thankfully, &lt;code&gt;sklearn&lt;/code&gt; can help us out a lot here. Make sure to grab the dataset from classroom and let&amp;rsquo;s dive in.&lt;/p&gt;&#xA;&lt;p&gt;As always, load in your data and our libraries,&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; pandas &lt;span style=&#34;color:#66d9ef&#34;&gt;as&lt;/span&gt; pd&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; matplotlib.pyplot &lt;span style=&#34;color:#66d9ef&#34;&gt;as&lt;/span&gt; plt&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;%&lt;/span&gt;matplotlib inline&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;df &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; pd&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;read_csv(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;usedcarprices.csv&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Let&amp;rsquo;s visualize our data so we can tell what type of model we should use;&lt;/p&gt;</description>
    </item>
    <item>
      <title>One Hot Encoding</title>
      <link>https://mrpointing.com/notes/computer-science/python/machine-learning/one-hot-encoding/</link>
      <pubDate>Wed, 29 Oct 2025 00:00:00 +0000</pubDate>
      <guid>https://mrpointing.com/notes/computer-science/python/machine-learning/one-hot-encoding/</guid>
      <description>&lt;hr&gt;&#xA;&lt;p&gt;Each time we learn a new model, our goal remains slightly the same; build a model that trains on input data to predict accurate output. One thing that has changed with each model is the type of data, or how we use it. This time, we&amp;rsquo;re going to learn how we handle text information, slightly more complicated than numbers.&lt;/p&gt;&#xA;&lt;p&gt;We know that Python doesn&amp;rsquo;t understand English, or any human language for that matter. All it understands is numbers, so anytime we have data that is mostly string data we should and usually have to transfer it into another data type. If our computers have a hard time with words and have an easy time with numbers, it makes sense we should convert all strings into numbers. Well, how could we do that?&lt;/p&gt;</description>
    </item>
    <item>
      <title>Gradient Descent</title>
      <link>https://mrpointing.com/notes/computer-science/python/machine-learning/gradient-descent/</link>
      <pubDate>Thu, 02 Oct 2025 00:00:00 +0000</pubDate>
      <guid>https://mrpointing.com/notes/computer-science/python/machine-learning/gradient-descent/</guid>
      <description>&lt;hr&gt;&#xA;&lt;p&gt;This one will be a quick one, but it&amp;rsquo;s really important. We know that given an input dataset, and given a &lt;em&gt;function&lt;/em&gt;, we can calculate the output. For example, if we have $x=[1, 2, 3]$, and the function $y=3x-2$, we could reasonably figure out the dataset of $y$; $[1, 4, 7]$. Another term for this function, in the case of Machine Learning, is a &lt;em&gt;prediction function&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Sometimes, we&amp;rsquo;re only given the input and output data. It would be incredibly helpful if we were able to figure out that prediction function, so we can predict unseen input values with precision. We&amp;rsquo;re actually going to continue working with the dataset we began working with in single variable linear regression.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Linear Regression</title>
      <link>https://mrpointing.com/notes/computer-science/python/machine-learning/linear-regression/</link>
      <pubDate>Sun, 21 Sep 2025 00:00:00 +0000</pubDate>
      <guid>https://mrpointing.com/notes/computer-science/python/machine-learning/linear-regression/</guid>
      <description>&lt;hr&gt;&#xA;&lt;h1 id=&#34;single-variable&#34;&gt;Single Variable&lt;/h1&gt;&#xA;&lt;p&gt;A great beginner model, &lt;em&gt;Linear Regression&lt;/em&gt; uses input and output features to predict new inputs. There are lots of things we can predict; stock prices, collectibles, cars, you name it. An easy one we can use for now is home prices. Take the following table for example;&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;Area&lt;/th&gt;&#xA;          &lt;th&gt;Price&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;1750&lt;/td&gt;&#xA;          &lt;td&gt;465000&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;2000&lt;/td&gt;&#xA;          &lt;td&gt;545000&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;2300&lt;/td&gt;&#xA;          &lt;td&gt;570000&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;2800&lt;/td&gt;&#xA;          &lt;td&gt;595000&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;3200&lt;/td&gt;&#xA;          &lt;td&gt;614000&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;Our objective is to create a model that will correctly price out a new house given we provide a square footage area. We can see a really clear pattern; as the area increase, the price increases. We could easily plot this on a scatter plot and see the correlation. We should also remember from algebra that we can create a line of best fit, that would minimize the amount of error between the expected amount and the actual amount (the price). Sounds, confusing, let&amp;rsquo;s actually see what happens.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
