<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mark Zaky</title>
    <description>The latest articles on DEV Community by Mark Zaky (@markzaky3).</description>
    <link>https://dev.to/markzaky3</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F158055%2F42d01e7e-9a87-4025-9b03-b224180ae8d1.jpg</url>
      <title>DEV Community: Mark Zaky</title>
      <link>https://dev.to/markzaky3</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/markzaky3"/>
    <language>en</language>
    <item>
      <title>What is SVM or Support Vector Machine?</title>
      <dc:creator>Mark Zaky</dc:creator>
      <pubDate>Wed, 24 Aug 2022 08:30:23 +0000</pubDate>
      <link>https://dev.to/markzaky3/what-is-svm-or-support-vector-machine-2k42</link>
      <guid>https://dev.to/markzaky3/what-is-svm-or-support-vector-machine-2k42</guid>
      <description>&lt;p&gt;In machine learning, one of the most repeated tasks is classifying objects to certain criteria, into multiple categories.&lt;/p&gt;

&lt;h1&gt;
  
  
  Examples of Classification problems
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;is this email spam or not?&lt;/li&gt;
&lt;li&gt;is this a dog or a cat?&lt;/li&gt;
&lt;li&gt;is the stock going up or down?&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  How SVM works?
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5fhiefyb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eev65bm3x672eebqn9g6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5fhiefyb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eev65bm3x672eebqn9g6.jpg" alt="SVM" width="694" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each object you want to classify is represented as a point on plane or let's call it an n-dimensional space&lt;br&gt;
where each coordinate is a feature of the classification process.&lt;/p&gt;

&lt;p&gt;SVMs handles the classification tasks by drawing a line dividing the dataset into two groups&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fndjXdOb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mu6gycaedmhqfur9nq99.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fndjXdOb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mu6gycaedmhqfur9nq99.png" alt="SVM" width="540" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and if it's a 3 dimensional plane. it draws a plane like this&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6M-Kht8k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xsg66whm4f47v1tm6trr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6M-Kht8k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xsg66whm4f47v1tm6trr.png" alt="2D SVM" width="880" height="660"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and since there are many possibilities to draw a line or a plane that divides the data, SVM tries to find the most fitting line.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0MFwOviB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4j8gr2efjjj8remqj8r8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0MFwOviB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4j8gr2efjjj8remqj8r8.png" alt="3D SVM" width="581" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SVM create a margin which is a space around the dividing line.&lt;br&gt;
to maximize the distance to points in either categories. and the points that fall on the margin are called the supporting vectors.&lt;/p&gt;

&lt;p&gt;SVM needs a dataset which is labeled, that's why SVM is supervised learning algorithm. which means it requires both X (Features) and Y (Output) Values.&lt;/p&gt;

&lt;p&gt;SVM solves a convex optimization problem which is also known as a &lt;strong&gt;Cost Function&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  SVM pros &amp;amp; cons
&lt;/h1&gt;

&lt;p&gt;SVM is simple, easy to understand and interpret, easy to use and implement. it also can perform well with small datasets.&lt;/p&gt;

&lt;p&gt;yet its simplicity is not always the best.&lt;br&gt;
not all data can always be split by a plane.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--scK9432I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fhxthls3wefsa3wx61ja.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--scK9432I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fhxthls3wefsa3wx61ja.png" alt="Plane doesn't fit" width="485" height="374"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A common workaround to this problem is called the &lt;strong&gt;Kernel Trick&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2BSSRCi6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/evliiu7yyvikq3qumg0z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2BSSRCi6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/evliiu7yyvikq3qumg0z.png" alt="Kernel Trick" width="838" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;we can augment data with some nonlinear features that are computed from the existing ones. then find the seperating hyperplane.&lt;/p&gt;

&lt;p&gt;you can now start implementing SVM models using scikit learn.&lt;br&gt;
opening a lot of doors for a variety of ML applications.&lt;/p&gt;

</description>
      <category>svm</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
