{"id":8013,"date":"2020-12-29T00:26:24","date_gmt":"2020-12-29T00:26:24","guid":{"rendered":"https:\/\/healinglifespan.com\/data-science\/2020\/12\/29\/seven-most-popular-svm-kernels\/"},"modified":"2020-12-29T00:26:24","modified_gmt":"2020-12-29T00:26:24","slug":"seven-most-popular-svm-kernels","status":"publish","type":"post","link":"https:\/\/wealthrevelation.com\/data-science\/2020\/12\/29\/seven-most-popular-svm-kernels\/","title":{"rendered":"Seven Most Popular SVM Kernels"},"content":{"rendered":"<div id=\"tve_editor\" data-post-id=\"7908\">\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-17667869e8d\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/1-Support-Vector-Machine-SVM-kernels.png?resize=619%2C372&amp;ssl=1\" class=\"tve_image wp-image-7910\" alt=\"Support Vector Machine SVM kernels\" data-id=\"7910\" width=\"619\" data-init-width=\"750\" height=\"372\" data-init-height=\"450\" title=\"Support Vector Machine SVM kernels\" loading=\"lazy\" data-width=\"619\" data-height=\"372\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7910\" alt=\"Support Vector Machine SVM kernels\" data-id=\"7910\" width=\"619\" data-init-width=\"750\" height=\"372\" data-init-height=\"450\" title=\"Support Vector Machine SVM kernels\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/1-Support-Vector-Machine-SVM-kernels.png?resize=619%2C372&amp;ssl=1\" data-width=\"619\" data-height=\"372\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element tve-froala fr-box fr-basic\" data-css=\"tve-u-17667869e97\">\n<p dir=\"ltr\">\u00a0 \u00a0 While explaining the <a href=\"https:\/\/dataaspirant.com\/svm-classifier-implemenation-python-scikit-learn\/\" target=\"_blank\" class=\"tve-froala fr-basic\" rel=\"noopener noreferrer\"><strong>support vector machine<\/strong><\/a>, SVM algorithm, we said we have various svm kernel functions that help changing the data dimensions.<\/p>\n<p dir=\"ltr\">So In this article, we are going to dive deep into svm algorithm and SVM\u2019s kernel functions. <\/p>\n<p dir=\"ltr\">Let me give you a quick <a href=\"https:\/\/dataaspirant.com\/support-vector-machine-algorithm\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>introduction of svm<\/strong><\/a> and its kernels.\u00a0<\/p>\n<p dir=\"ltr\">We already know that SVM is a supervised machine learning algorithm used to deal with both <a href=\"https:\/\/dataaspirant.com\/classification-and-prediction\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>classification and regression problems<\/strong><\/a>. Compared to the other classification and regression algorithms, the svm approach is completely different.\u00a0<\/p>\n<p dir=\"ltr\">One key reason for this is <strong>svm kernel<\/strong> functions.<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_tw_qs tve_clearfix\" data-url=\"https:\/\/twitter.com\/intent\/tweet\" data-via=\"\" data-use_custom_url=\"\" data-css=\"tve-u-17667869ed4\">\n<div class=\"thrv_tw_qs_container\">\n<div class=\"thrv_tw_quote\">\n<p>Learn about the most popular SVM kernels along with the implementation in python #svm #svmkernels #classification #regression #machinelearning #datascience #python<\/p>\n<\/p><\/div>\n<p>\n\t\t\t<span><br \/>\n\t\t\t\t<i><\/i><br \/>\n\t\t\t\t<span class=\"thrv_tw_qs_button_text thrv-inline-text tve_editable\">Click to Tweet<\/span><br \/>\n\t\t\t<\/span>\n\t\t<\/p>\n<\/p><\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-17667869ed5\">\n<p dir=\"ltr\">Kernel plays a vital role in classification and is used to analyze some patterns in the given dataset. They are very helpful in solving a <strong>no-linear problem<\/strong> by using a <a href=\"https:\/\/dataaspirant.com\/implement-logistic-regression-model-python-binary-classification\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>linear classifier<\/strong><\/a>.\u00a0<\/p>\n<p dir=\"ltr\">Later the svm algorithm uses <strong>kernel-trick<\/strong> for transforming the data points and creating an optimal decision boundary. Kernels help us to deal with <strong>high dimensional<\/strong> data in a very efficient manner.\u00a0<\/p>\n<p dir=\"ltr\">We have various svm kernel functions to convert the non-linear data to linear. In this article, we listed 7 such popular svm kernel functions.<\/p>\n<p dir=\"ltr\">Before we drive further, let\u2019s have a look at the topics you are going to learn in this article.<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-17667869ed8\">\n<p dir=\"ltr\">Let\u2019s start the article with SVM. If you are interested in the sum algorithm implementation in python and R programming language, please refer to below two articles.<\/p>\n<h2 id=\"t-1608054630718\" class=\"\">What Is the Support Vector Machine (SVM)?<\/h2>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-176678ae2c6\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/2-What-is-Support-Vector-Machine.png.png?resize=619%2C372&amp;ssl=1\" class=\"tve_image wp-image-7919\" alt=\"What is Support Vector Machine.png\" data-id=\"7919\" width=\"619\" data-init-width=\"750\" height=\"372\" data-init-height=\"450\" title=\"What is Support Vector Machine.png\" loading=\"lazy\" data-width=\"619\" data-height=\"372\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7919\" alt=\"What is Support Vector Machine.png\" data-id=\"7919\" width=\"619\" data-init-width=\"750\" height=\"372\" data-init-height=\"450\" title=\"What is Support Vector Machine.png\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/2-What-is-Support-Vector-Machine.png.png?resize=619%2C372&amp;ssl=1\" data-width=\"619\" data-height=\"372\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element tve-froala fr-box fr-basic\">\n<p dir=\"ltr\">SVM is a famous <a href=\"https:\/\/dataaspirant.com\/supervised-and-unsupervised-learning\/\" target=\"_blank\" class=\"tve-froala\" rel=\"noopener noreferrer\"><strong>supervised machine learning algorithm<\/strong><\/a> used for<strong>\u00a0<\/strong>classification as well as<strong>\u00a0<\/strong><a href=\"https:\/\/dataaspirant.com\/linear-regression\/\" target=\"_blank\" class=\"tve-froala\" rel=\"noopener noreferrer\"><strong>regression algorithm<\/strong><strong>s.<\/strong><\/a> However, \u00a0mostly it is preferred for classification algorithms. It basically separates different target classes in a hyperplane in <strong>n-dimensional<\/strong> or multidimensional space.<\/p>\n<p dir=\"ltr\">The main motive of the SVM is to create the <strong>best decision boundary<\/strong> that can separate two or more classes(with <strong>maximum margin<\/strong>) so that we can correctly put new data points in the correct class.\u00a0<\/p>\n<p dir=\"ltr\">Wait! <\/p>\n<blockquote class=\"\"><p><strong>Why is it known as SVM? <\/strong><\/p><\/blockquote>\n<p dir=\"ltr\">Because It chooses <strong>extreme vectors or support vectors<\/strong> to create the hyperplane, that\u2019s why it is named so. In the below sections let&#8217;s understand in more detail.<\/p>\n<h2 id=\"t-1608054630719\" class=\"\">SVM Algorithm Explanation<\/h2>\n<p dir=\"ltr\">To understand the SVM algorithm, we need to know about <strong>hyperplanes<\/strong> and <strong>support vectors<\/strong>.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-176678d46f7\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/3-Support-Vector-Machine-Algorithm.png?resize=619%2C439&amp;ssl=1\" class=\"tve_image wp-image-7922\" alt=\"Support Vector Machine Algorithm\" data-id=\"7922\" width=\"619\" data-init-width=\"1024\" height=\"439\" data-init-height=\"726\" title=\"Support Vector Machine Algorithm\" loading=\"lazy\" data-width=\"619\" data-height=\"439\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7922\" alt=\"Support Vector Machine Algorithm\" data-id=\"7922\" width=\"619\" data-init-width=\"1024\" height=\"439\" data-init-height=\"726\" title=\"Support Vector Machine Algorithm\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/3-Support-Vector-Machine-Algorithm.png?resize=619%2C439&amp;ssl=1\" data-width=\"619\" data-height=\"439\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 id=\"t-1608054630720\" class=\"\">SVM Hyperplane<\/h3>\n<p dir=\"ltr\">There may be <strong>multiple<\/strong> lines\/decision boundaries to segregate the classes in n-dimensional space. Still, we want to search out the <strong>simplest decision<\/strong> boundary that helps to classify the information points.\u00a0<\/p>\n<p dir=\"ltr\">This best boundary is considered to be the <strong>hyperplane of SVM<\/strong>. The dimensions of the hyperplane rely on the features present within the dataset. These features suggest if there are 2 target labels in the dataset.\u00a0<\/p>\n<p dir=\"ltr\">Then the hyperplane is going to be a line. And if there are 3 target labels, then the hyperplane is going to be a 2-dimension plane. We always create a hyperplane that provides <strong>maximum margin<\/strong>. This margin simply means there should be a <strong>maximum distance<\/strong> between the data points.<\/p>\n<h3 id=\"t-1608054630721\" class=\"\">SVM Support Vectors<\/h3>\n<p dir=\"ltr\">Support vectors are defined as the data points, which are closest to the hyperplane and have some effect on its position. \u00a0As these vectors are supporting the hyperplane, therefore named as Support vectors.<\/p>\n<p dir=\"ltr\">I guess now it\u2019s clear what svm is. Let&#8217;s use this understanding and pick an example to learn how the svm algorithm works.<\/p>\n<h2 id=\"t-1608054630722\" class=\"\">How the SVM Algorithm Works<\/h2>\n<p dir=\"ltr\">As discussed, it mainly focuses on creating a hyperplane to separate target classes. Let me explain this by using a particular problem.\u00a0<\/p>\n<p dir=\"ltr\">Suppose you are having the dataset as shown below in the image. Now, you have to classify the target classes.\u00a0<\/p>\n<ul>\n<li class=\"\">Green circles<\/li>\n<li class=\"\">Blue squares<\/li>\n<\/ul>\n<p dir=\"ltr\">Basically, you have to make a decision boundary to <strong>separate<\/strong> these two classes.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-176678e7796\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/4-SVM-Example-01.png?resize=520%2C424&amp;ssl=1\" class=\"tve_image wp-image-7925\" alt=\"SVM Example 01\" data-id=\"7925\" width=\"520\" data-init-width=\"1024\" height=\"424\" data-init-height=\"835\" title=\"SVM Example 01\" loading=\"lazy\" data-width=\"520\" data-height=\"424\" data-css=\"tve-u-1766cc712dc\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7925\" alt=\"SVM Example 01\" data-id=\"7925\" width=\"520\" data-init-width=\"1024\" height=\"424\" data-init-height=\"835\" title=\"SVM Example 01\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/4-SVM-Example-01.png?resize=520%2C424&amp;ssl=1\" data-width=\"520\" data-height=\"424\" data-css=\"tve-u-1766cc712dc\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">Not rocket science, right?<\/p>\n<p dir=\"ltr\">But, as you notice, there isn\u2019t a particular line that does this work. In fact, we have multiple lines that can separate these two classes.\u00a0<\/p>\n<p dir=\"ltr\">So, <\/p>\n<blockquote class=\"\"><p>How does SVM find the<strong> best line to segregate<\/strong> the classes???<\/p><\/blockquote>\n<p dir=\"ltr\">Let\u2019s take some probable candidates and sort the things.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-176678f4991\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/5-SVM-Example-02.png?resize=527%2C432&amp;ssl=1\" class=\"tve_image wp-image-7928\" alt=\"SVM Example 02\" data-id=\"7928\" width=\"527\" data-init-width=\"1024\" height=\"432\" data-init-height=\"839\" title=\"SVM Example 02\" loading=\"lazy\" data-width=\"527\" data-height=\"432\" data-css=\"tve-u-1766cc79d1a\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7928\" alt=\"SVM Example 02\" data-id=\"7928\" width=\"527\" data-init-width=\"1024\" height=\"432\" data-init-height=\"839\" title=\"SVM Example 02\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/5-SVM-Example-02.png?resize=527%2C432&amp;ssl=1\" data-width=\"527\" data-height=\"432\" data-css=\"tve-u-1766cc79d1a\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">We have <strong>three lines<\/strong> here. Which line as per you best separates the data?<\/p>\n<p dir=\"ltr\">If you\u2019re selecting the <strong>middle<\/strong> line, then fantastic because that&#8217;s the line we are searching for. It can be observed more easily in this case than in the other two lines.<\/p>\n<p dir=\"ltr\">But, we\u2019d like something concrete to repair our line. Though they can classify the datasets, too, it\u2019s not a generalized line, and in machine learning, our main target is to look for a more generalized separator.<\/p>\n<h3 id=\"t-1608054630723\" class=\"\">How does the SVM find the best line?<\/h3>\n<p dir=\"ltr\">According to the SVM algorithm, we search for the points nearest the decision boundary from both the classes. These points are called support vectors.\u00a0<\/p>\n<p dir=\"ltr\">Now, we have to <a href=\"https:\/\/dataaspirant.com\/five-most-popular-similarity-measures-implementation-in-python\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>calculate the distance<\/strong><\/a> between the line and the support vectors. This distance is known as the margin. Our target is to <strong>maximize<\/strong> the <strong>margin<\/strong>.\u00a0<\/p>\n<p dir=\"ltr\">Svm always looks for optimal margin, i.e., for which the margin is maximum.\u00a0<\/p>\n<p dir=\"ltr\">Now, you must be wondering why svm tries to keep the maximum separation gap between the two classes. It is done so that the model can efficiently predict future data points.\u00a0<\/p>\n<p dir=\"ltr\">Well, it was a bit simple to segregate the above dataset. What if our dataset is a bit complex.\u00a0\u00a0<\/p>\n<p dir=\"ltr\">Let me explain with an example.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-17667923470\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/6-SVM-Example-03.png?resize=520%2C499&amp;ssl=1\" class=\"tve_image wp-image-7931\" alt=\"SVM Example 03\" data-id=\"7931\" width=\"520\" data-init-width=\"1024\" height=\"499\" data-init-height=\"982\" title=\"SVM Example 03\" loading=\"lazy\" data-width=\"520\" data-height=\"499\" data-css=\"tve-u-1766cc7e834\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7931\" alt=\"SVM Example 03\" data-id=\"7931\" width=\"520\" data-init-width=\"1024\" height=\"499\" data-init-height=\"982\" title=\"SVM Example 03\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/6-SVM-Example-03.png?resize=520%2C499&amp;ssl=1\" data-width=\"520\" data-height=\"499\" data-css=\"tve-u-1766cc7e834\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">So, now you can see that this dataset is <strong>not linearly<\/strong> separable. Just by drawing a line, you cannot classify this dataset. When solving real-world problems, you will get such types of non-linear data.\u00a0<\/p>\n<p dir=\"ltr\">It\u2019s clear that we cannot classify the dataset by a <a href=\"https:\/\/dataaspirant.com\/how-logistic-regression-model-works\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>linear decision boundary<\/strong><\/a>, but, this data can be converted into a linear one using <strong>higher dimensions<\/strong>.\u00a0<\/p>\n<p dir=\"ltr\">Surprising, right?<\/p>\n<p dir=\"ltr\">Let\u2019s create one more dimension and name it as <strong>z.<\/strong><\/p>\n<p dir=\"ltr\">Hold on!, <\/p>\n<blockquote class=\"\"><p><strong>How to calculate dimensions for z? <\/strong><\/p><\/blockquote>\n<p dir=\"ltr\">Well, it can be done by using the following equation<\/p>\n<p dir=\"ltr\" data-css=\"tve-u-1766ca7c0df\">\u00a0 \u00a0<strong>Z = x^2+y^2 \u00a0 \u00a0&#8211; equation(1) <\/strong><\/p>\n<p dir=\"ltr\">By adding this dimension, we will get three-dimensional space.\u00a0<\/p>\n<p dir=\"ltr\">Let&#8217;s see how it will looks like.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-17667936bcb\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/7-SVM-Example-04.png?resize=513%2C525&amp;ssl=1\" class=\"tve_image wp-image-7934\" alt=\"SVM Example 04\" data-id=\"7934\" width=\"513\" data-init-width=\"1001\" height=\"525\" data-init-height=\"1024\" title=\"SVM Example 04\" loading=\"lazy\" data-width=\"513\" data-height=\"525\" data-css=\"tve-u-176679383b1\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7934\" alt=\"SVM Example 04\" data-id=\"7934\" width=\"513\" data-init-width=\"1001\" height=\"525\" data-init-height=\"1024\" title=\"SVM Example 04\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/7-SVM-Example-04.png?resize=513%2C525&amp;ssl=1\" data-width=\"513\" data-height=\"525\" data-css=\"tve-u-176679383b1\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">Now you can see that the data has become <strong>linearly separable<\/strong>. As we are in three-dimensions now, the hyperplane we got is parallel to the x-axis at a particular value of z(say d).\u00a0<\/p>\n<p dir=\"ltr\">\u00a0 \u00a0<strong>So we have, d = x^2+y^2 \u00a0 (from equation 1)<\/strong><\/p>\n<p dir=\"ltr\">We can see that it is the equation of a circle. Hence, we can convert our linear separator in higher dimensions back to the original dimensions using this equation.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1766794d754\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/8-SVM-Example-04.png?resize=486%2C446&amp;ssl=1\" class=\"tve_image wp-image-7937\" alt=\"SVM Example 04\" data-id=\"7937\" width=\"486\" data-init-width=\"1024\" height=\"446\" data-init-height=\"940\" title=\"SVM Example 04\" loading=\"lazy\" data-width=\"486\" data-height=\"446\" data-css=\"tve-u-1766cc888b6\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7937\" alt=\"SVM Example 04\" data-id=\"7937\" width=\"486\" data-init-width=\"1024\" height=\"446\" data-init-height=\"940\" title=\"SVM Example 04\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/8-SVM-Example-04.png?resize=486%2C446&amp;ssl=1\" data-width=\"486\" data-height=\"446\" data-css=\"tve-u-1766cc888b6\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element tve-froala fr-box fr-basic\">\n<p dir=\"ltr\">Yayy, here we go. Our decision boundary or hyperplane is a circle, which separates both the classes efficiently.\u00a0<\/p>\n<p dir=\"ltr\">In the SVM classifier, it\u2019s easy to make a linear hyperplane between these two classes. But, another curious question which arises is, <\/p>\n<blockquote class=\"\"><p>Do we have to implement this feature by own to make a hyperplane? <\/p><\/blockquote>\n<p dir=\"ltr\">The answer is, <strong>No, <\/strong><\/p>\n<p dir=\"ltr\">The SVM algorithm takes care of that by using a technique called the <strong>kernel trick<\/strong>. The SVM kernel could be a function that takes low dimensional input space and transforms it into a better dimensional space, i.e., it converts non-separable problems to separable problems.\u00a0<\/p>\n<p dir=\"ltr\">It helps us to deal with non-linear separation problems. Simply put, it does some extremely complex data transformations, then finds out the method to separate the data points based on the target classes you\u2019ve defined.<\/p>\n<p dir=\"ltr\">I guess now everything is sorted regarding <strong>svm logic<\/strong>. Let\u2019s see why and where we use SVMs.\u00a0<\/p>\n<h2 id=\"t-1608054630724\" class=\"\">SVM Applications<\/h2>\n<p dir=\"ltr\">SVMs are utilized in applications like\u00a0<\/p>\n<p dir=\"ltr\">That\u2019s why we prefer SVMs in various <a href=\"https:\/\/dataaspirant.com\/category\/projects\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>machine learning applications<\/strong><\/a>. Also, it can handle both <a href=\"https:\/\/dataaspirant.com\/classification-and-prediction\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>classification and regression<\/strong><\/a> on linear and non-linear data.<\/p>\n<p dir=\"ltr\">Another reason we use SVMs is because they help us to find complex relationships among the provided dataset without you involving in plenty of transformations on your own.\u00a0<\/p>\n<p dir=\"ltr\">It is a great algorithm to choose when you are working with smaller datasets that have tens to many thousands of features. They typically find more accurate results when put next to <a href=\"https:\/\/dataaspirant.com\/decision-tree-classifier-implementation-in-r\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>other algorithms<\/strong><\/a> due to their ability to handle small, complex datasets.<\/p>\n<p dir=\"ltr\">Finally, we are clear with various aspects of svm. Now, let\u2019s dive deep and read about the most useful feature of the svm algorithm.\u00a0<\/p>\n<p dir=\"ltr\"><strong>What\u2019s that ?? <\/strong><\/p>\n<p dir=\"ltr\">It\u2019s none other than kernels. Kernels help a lot when we have to deal with complex datasets. Their job is to get data as input and transform it into any required form.\u00a0<\/p>\n<p dir=\"ltr\">They\u2019re significant in SVM as they assist in determining various important things.<\/p>\n<h2 id=\"t-1608054630725\" class=\"\">SVM Kernel Functions<\/h2>\n<p dir=\"ltr\">SVM algorithms use a group of mathematical functions that are known as kernels. The function of a kernel is to require data as input and transform it into the desired form.\u00a0<\/p>\n<p dir=\"ltr\">Different SVM algorithms use differing kinds of kernel functions. These functions are of different kinds\u2014for instance, linear, nonlinear, polynomial, radial basis function (RBF), and sigmoid.<\/p>\n<p dir=\"ltr\">The most preferred kind of kernel function is RBF. Because it&#8217;s localized and has a finite response along the complete x-axis.<\/p>\n<p dir=\"ltr\">The kernel functions return the scalar product between two points in an exceedingly suitable feature space. Thus by defining a notion of resemblance, with a little computing cost even in the case of very high-dimensional spaces.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-17667961e3a\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/9-SVM-kernal-Equation.png?resize=516%2C158&amp;ssl=1\" class=\"tve_image wp-image-7941\" alt=\"SVM kernal Equation\" data-id=\"7941\" width=\"516\" data-init-width=\"516\" height=\"158\" data-init-height=\"158\" title=\"SVM kernal Equation\" loading=\"lazy\" data-width=\"516\" data-height=\"158\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7941\" alt=\"SVM kernal Equation\" data-id=\"7941\" width=\"516\" data-init-width=\"516\" height=\"158\" data-init-height=\"158\" title=\"SVM kernal Equation\" loading=\"lazy\" src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/9-SVM-kernal-Equation.png?resize=516%2C158&amp;ssl=1\" data-width=\"516\" data-height=\"158\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h2 id=\"t-1608054630726\" class=\"\">Popular SVM Kernel Functions<\/h2>\n<h3 id=\"t-1608054630727\" class=\"\">Linear Kernel<\/h3>\n<p dir=\"ltr\">It is the most basic type of kernel, usually one dimensional in nature. It proves to be the best function when there are lots of features. The linear kernel is mostly preferred for <a href=\"https:\/\/dataaspirant.com\/nlp-text-preprocessing-techniques-implementation-python\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>text-classification problems<\/strong><\/a> as most of these kinds of classification problems can be linearly separated.<\/p>\n<p dir=\"ltr\">Linear kernel functions are <strong>faster<\/strong> than other functions.\u00a0<\/p>\n<h4 class=\"\">Linear Kernel Formula <\/h4>\n<p dir=\"ltr\" data-css=\"tve-u-1766ca94a6b\"><strong>F(x, xj) = sum( x.xj)<\/strong><\/p>\n<p dir=\"ltr\">Here, <strong>x, xj<\/strong> represents the data you\u2019re trying to classify.<\/p>\n<h3 id=\"t-1608054630728\" class=\"\">Polynomial Kernel\u00a0<\/h3>\n<p dir=\"ltr\" id=\"t-1608054630729\">It is a more generalized representation of the linear kernel. It<strong> is not<\/strong> as preferred as other kernel functions as it is <strong>less efficient<\/strong> and accurate.<\/p>\n<h4 class=\"\">Polynomial Kernel Formula<\/h4>\n<p dir=\"ltr\" data-css=\"tve-u-1766ca9f3a2\"><strong>F(x, xj) = (x.xj+1)^d<\/strong><\/p>\n<p dir=\"ltr\">Here \u2018.\u2019 shows the <strong>dot product<\/strong> of both the values, and <strong>d<\/strong> denotes the degree.\u00a0<\/p>\n<p dir=\"ltr\">F(x, xj) representing the <strong>decision boundary<\/strong> to separate the given classes.\u00a0<\/p>\n<h3 id=\"t-1608054630730\" class=\"\">Gaussian Radial Basis Function (RBF)\u00a0<\/h3>\n<p dir=\"ltr\" id=\"t-1608054630731\">\u00a0It is one of the most preferred and used kernel functions in svm. It is usually chosen for non-linear data. It helps to make proper separation when there is no prior knowledge of data.<\/p>\n<h4 class=\"\">Gaussian Radial Basis Formula<\/h4>\n<p dir=\"ltr\" data-css=\"tve-u-1766caabf6f\"><strong>F(x, xj) = exp(-gamma * ||x &#8211; xj||^2)<\/strong><\/p>\n<p dir=\"ltr\">The value of gamma varies from <strong>0 to 1<\/strong>. You have to manually provide the value of gamma in the code. The most preferred value for <strong>gamma is 0.1<\/strong>.<\/p>\n<h3 id=\"t-1608054630732\" class=\"\">Sigmoid Kernel<\/h3>\n<p dir=\"ltr\" id=\"t-1608054630733\">\u00a0It is mostly preferred for <a href=\"https:\/\/dataaspirant.com\/neural-network-basics\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>neural networks<\/strong><\/a>. This kernel function is similar to a two-layer perceptron model of the neural network, which works as an <a href=\"https:\/\/dataaspirant.com\/popular-activation-functions-neural-networks\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>activation function<\/strong><\/a> for neurons.<\/p>\n<p dir=\"ltr\">It can be shown as,<\/p>\n<h4 class=\"\">Sigmoid Kenel Function<\/h4>\n<p dir=\"ltr\" data-css=\"tve-u-1766cab69ed\"><strong>F(x, xj) = tanh(\u03b1xay + c)<\/strong><\/p>\n<h3 id=\"t-1608054630734\" class=\"\">Gaussian Kernel<\/h3>\n<p dir=\"ltr\" id=\"t-1608054630735\">It is a commonly used kernel. It is used when there is no prior knowledge of a given dataset.<\/p>\n<h4 class=\"\">Gaussian Kernel Formula<\/h4>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1766798206a\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/10-Gaussian-Kernel-Function.png?resize=226%2C66&amp;ssl=1\" class=\"tve_image wp-image-7946\" alt=\"Gaussian Kernel Function\" data-id=\"7946\" width=\"226\" data-init-width=\"226\" height=\"66\" data-init-height=\"66\" title=\"Gaussian Kernel Function\" loading=\"lazy\" data-width=\"226\" data-height=\"66\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7946\" alt=\"Gaussian Kernel Function\" data-id=\"7946\" width=\"226\" data-init-width=\"226\" height=\"66\" data-init-height=\"66\" title=\"Gaussian Kernel Function\" loading=\"lazy\" src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/10-Gaussian-Kernel-Function.png?resize=226%2C66&amp;ssl=1\" data-width=\"226\" data-height=\"66\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 id=\"t-1608054630736\" class=\"\">Bessel function kernel<\/h3>\n<p dir=\"ltr\">It is mainly used for removing the cross term in mathematical functions.<\/p>\n<h4 class=\"\">Bassel Kernel Formula <\/h4>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-17667991276\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/11-Bessel-kernel-function.png?resize=195%2C44&amp;ssl=1\" class=\"tve_image wp-image-7949\" alt=\"Bessel kernel function\" data-id=\"7949\" width=\"195\" data-init-width=\"195\" height=\"44\" data-init-height=\"44\" title=\"Bessel kernel function\" loading=\"lazy\" data-width=\"195\" data-height=\"44\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7949\" alt=\"Bessel kernel function\" data-id=\"7949\" width=\"195\" data-init-width=\"195\" height=\"44\" data-init-height=\"44\" title=\"Bessel kernel function\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/11-Bessel-kernel-function.png?resize=195%2C44&amp;ssl=1\" data-width=\"195\" data-height=\"44\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">Here J is the Bessel function.\u00a0<\/p>\n<h3 id=\"t-1608054630737\" class=\"\">ANOVA kernel<\/h3>\n<p dir=\"ltr\">It is also known as a radial basis function kernel. It usually performs well in multidimensional regression problems.<\/p>\n<h4 class=\"\">Anova Kernel Formula<\/h4>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-176679a1459\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/12-ANOVA-radial-basis-kernel.png?resize=256%2C52&amp;ssl=1\" class=\"tve_image wp-image-7953\" alt=\"ANOVA radial basis kernel\" data-id=\"7953\" width=\"256\" data-init-width=\"256\" height=\"52\" data-init-height=\"52\" title=\"ANOVA radial basis kernel\" loading=\"lazy\" data-width=\"256\" data-height=\"52\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7953\" alt=\"ANOVA radial basis kernel\" data-id=\"7953\" width=\"256\" data-init-width=\"256\" height=\"52\" data-init-height=\"52\" title=\"ANOVA radial basis kernel\" loading=\"lazy\" src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/12-ANOVA-radial-basis-kernel.png?resize=256%2C52&amp;ssl=1\" data-width=\"256\" data-height=\"52\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element tve-froala fr-box fr-basic\">\n<h2 class=\"\" id=\"t-1608054630738\">Implementing SVM Kernel Functions In Python<\/h2>\n<p dir=\"ltr\">We have discussed the theoretical information about the kernel functions so far. Let\u2019s see the \u00a0practical implementation to get the proper grip on the concept.\u00a0<\/p>\n<p dir=\"ltr\">Here, we will be using the <a href=\"https:\/\/scikit-learn.org\/stable\/auto_examples\/datasets\/plot_iris_dataset.html\" target=\"_blank\" class=\"tve-froala\" rel=\"noopener noreferrer\"><strong>scikitlearn<\/strong> <strong>iris dataset<\/strong>.<\/a><\/p>\n<p dir=\"ltr\">The first step is importing the required packages<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>In the above code after loading the required python packages, we are loading the popular classification dataset iris.<\/p>\n<p>Then we splitting the loaded data into features and target data. Following the we written code to plot that.<\/p>\n<p>Now Let&#8217;s implement few of the svm kernel functions we discussed in this article.<\/p>\n<h3 id=\"t-1608140512018\">Linear Kernel Implementation<\/h3>\n<p dir=\"ltr\">Now we will make our svc classifier using a linear kernel.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1766cb8c31f\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/13-svc-classifier-using-linear-kernel.png?resize=458%2C335&amp;ssl=1\" class=\"tve_image wp-image-7969\" alt=\"svc classifier using linear kernel\" data-id=\"7969\" width=\"458\" data-init-width=\"458\" height=\"335\" data-init-height=\"335\" title=\"svc classifier using linear kernel\" loading=\"lazy\" data-width=\"458\" data-height=\"335\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7969\" alt=\"svc classifier using linear kernel\" data-id=\"7969\" width=\"458\" data-init-width=\"458\" height=\"335\" data-init-height=\"335\" title=\"svc classifier using linear kernel\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/13-svc-classifier-using-linear-kernel.png?resize=458%2C335&amp;ssl=1\" data-width=\"458\" data-height=\"335\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 id=\"t-1608140512019\">Sigmoid Kernel Implementation<\/h3>\n<p dir=\"ltr\">Now we will make our svc classifier using the sigmoid kernel.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1766cbbb6db\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/14-svc-classifier-using-sigmoid-kernel.png?resize=421%2C325&amp;ssl=1\" class=\"tve_image wp-image-7973\" alt=\"svc classifier using sigmoid kernel\" data-id=\"7973\" width=\"421\" data-init-width=\"421\" height=\"325\" data-init-height=\"325\" title=\"svc classifier using sigmoid kernel\" loading=\"lazy\" data-width=\"421\" data-height=\"325\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7973\" alt=\"svc classifier using sigmoid kernel\" data-id=\"7973\" width=\"421\" data-init-width=\"421\" height=\"325\" data-init-height=\"325\" title=\"svc classifier using sigmoid kernel\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/14-svc-classifier-using-sigmoid-kernel.png?resize=421%2C325&amp;ssl=1\" data-width=\"421\" data-height=\"325\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 id=\"t-1608140512020\" class=\"\">RBF Kernel Implementation<\/h3>\n<p dir=\"ltr\">Now we will make our svc classifier using rbf kernel.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1766cbdef28\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/15-svc-classifier-using-rbf-kernel.png?resize=400%2C316&amp;ssl=1\" class=\"tve_image wp-image-7977\" alt=\"svc classifier using rbf kernel\" data-id=\"7977\" width=\"400\" data-init-width=\"400\" height=\"316\" data-init-height=\"316\" title=\"svc classifier using rbf kernel\" loading=\"lazy\" data-width=\"400\" data-height=\"316\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7977\" alt=\"svc classifier using rbf kernel\" data-id=\"7977\" width=\"400\" data-init-width=\"400\" height=\"316\" data-init-height=\"316\" title=\"svc classifier using rbf kernel\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/15-svc-classifier-using-rbf-kernel.png?resize=400%2C316&amp;ssl=1\" data-width=\"400\" data-height=\"316\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 id=\"t-1608140512021\" class=\"\">Polynomial Kernel Implementation<\/h3>\n<p dir=\"ltr\">Now we will make our svc classifier using a polynomial kernel.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1766cc02396\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/16-svc-classifier-using-polynomial-kernel.png?resize=400%2C320&amp;ssl=1\" class=\"tve_image wp-image-7980\" alt=\"svc classifier using polynomial kernel\" data-id=\"7980\" width=\"400\" data-init-width=\"400\" height=\"320\" data-init-height=\"320\" title=\"svc classifier using polynomial kernel\" loading=\"lazy\" data-width=\"400\" data-height=\"320\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7980\" alt=\"svc classifier using polynomial kernel\" data-id=\"7980\" width=\"400\" data-init-width=\"400\" height=\"320\" data-init-height=\"320\" title=\"svc classifier using polynomial kernel\" loading=\"lazy\" src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/16-svc-classifier-using-polynomial-kernel.png?resize=400%2C320&amp;ssl=1\" data-width=\"400\" data-height=\"320\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">There are various kernels you can use for your project. It totally depends on you and the problem you\u2019re solving. <\/p>\n<p dir=\"ltr\">Like if you have to meet certain constraints, speed up the training time, or you have to <a href=\"https:\/\/dataaspirant.com\/hyperparameter-tuning-with-keras-tuner\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>tune the parameters<\/strong><\/a>.\u00a0<\/p>\n<h2 id=\"t-1608140512022\">How to choose the best SVM kernel for your dataset<\/h2>\n<p dir=\"ltr\">I am well aware of the fact that you must be having this question how to decide which kernel function will work efficiently for your dataset.\u00a0<\/p>\n<p dir=\"ltr\">It totally depends on what problem you\u2019re actually solving. If your data is linearly separable, without a second thought, go for a linear kernel.\u00a0<\/p>\n<p dir=\"ltr\">Because a linear kernel takes less training time when compared to other kernel functions. <\/p>\n<ul>\n<li class=\" dir=\">The <strong>linear kernel<\/strong> is mostly preferred for text classification problems as it performs well for large datasets.\u00a0<\/li>\n<li class=\" dir=\"><strong>Gaussian kernels<\/strong> tend to give good results when there is no additional information regarding data that is not available.<\/li>\n<li class=\" dir=\"><strong>Rbf kernel <\/strong>is also a kind of Gaussian kernel which projects the high dimensional data and then searches a linear separation for it.<\/li>\n<li class=\" dir=\"><strong>Polynomial kernels<\/strong> give good results for problems where all the training data is normalized.\u00a0<\/li>\n<\/ul>\n<p dir=\"ltr\">I hope that now the <strong>svm kernel functions<\/strong> got pretty straightforward for you. Let\u2019s see the advantages and disadvantages of using an svm algorithm.<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv-page-section thrv-lp-block\" data-inherit-lp-settings=\"1\" data-css=\"tve-u-1766cc140ba\" data-keep-css_id=\"1\">\n<div class=\"tve-page-section-in tve_empty_dropzone  \">\n<div class=\"thrv_wrapper thrv-columns dynamic-group-kbulxqe6\" data-css=\"tve-u-1766cc140bb\">\n<div class=\"tcb-flex-row v-2 tcb--cols--2\" data-css=\"tve-u-1766cc140bc\">\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbulxl9a\" data-css=\"tve-u-1766cc140bd\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbulxc3q\" data-css=\"tve-u-1766cc140be\">\n<div class=\"tve-cb\">\n<h3 class=\"\" id=\"t-1608140512023\">Advantages of SVM<\/h3>\n<div class=\"thrv_wrapper thrv-styled_list dynamic-group-kbulx7a0\" data-icon-code=\"icon-check\" data-css=\"tve-u-1766cc140c2\">\n<ul class=\"tcb-styled-list\">\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-1766cc140c3\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-1766cc140c5\">It works well on a dataset having many features.<\/span><\/li>\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-1766cc140c3\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-1766cc140c5\">It provides a clear margin of separation.<\/span><\/li>\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-1766cc140c3\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-1766cc140c5\">It is very effective for the dataset where the number of features are greater than the data points.<\/span><\/li>\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-1766cc140c3\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-1766cc140c5\">You can specify different kernel functions to make a proper decision boundary.<\/span><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbulxl9a\" data-css=\"tve-u-1766cc140c6\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbulxc3q\" data-css=\"tve-u-1766cc140c7\">\n<div class=\"tve-cb\">\n<h3 class=\"\" id=\"t-1608140512024\">Disadvantages of SVM<\/h3>\n<div class=\"thrv_wrapper thrv-styled_list dynamic-group-kbulx7a0\" data-icon-code=\"icon-times-solid\" data-css=\"tve-u-1766cc140ca\">\n<ul class=\"tcb-styled-list\">\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-1766cc140cb\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-1766cc140cd\">It requires very high training time, hence not recommended for large datasets.<\/span><\/li>\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-1766cc140ce\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-1766cc140d0\">It is very sensitive to outliers.<\/span><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element tve-froala fr-box fr-basic\">\n<h2 class=\"\" id=\"t-1608140512025\">Conclusion<\/h2>\n<p dir=\"ltr\">So, this is the end of this article. We discussed the SVM algorithm\u2014how it works and its applications. We also learned the important concept of SVM Kernel functions in detail.<\/p>\n<p dir=\"ltr\">In the end, we implemented these SVM kernel functions in python. I hope you have enjoyed and gathered lots of learnings from this article.<\/p>\n<h2 class=\"\" id=\"t-1608140512026\">What next<\/h2>\n<p dir=\"ltr\">I would suggest doing some hands-on using Python after reading this article. Do explore remaining classification algorithms on our platform that will be very useful for you. <\/p>\n<p dir=\"ltr\">Sharing you the other classification algorithms articles for you reference.<\/p>\n<\/div>\n<h4 class=\"\">Recommended Machine Learning Courses<\/h4>\n<div class=\"thrv_wrapper thrv-page-section thrv-lp-block\" data-inherit-lp-settings=\"1\" data-css=\"tve-u-17667869d75\" data-keep-css_id=\"1\">\n<div class=\"tve-page-section-in tve_empty_dropzone  \" data-css=\"tve-u-17481b960b8\">\n<div class=\"thrv_wrapper thrv-columns dynamic-group-kbt3q0q7\" data-css=\"tve-u-17481b95e2b\">\n<div class=\"tcb-flex-row v-2 tcb--cols--3 tcb-medium-no-wrap tcb-mobile-wrap m-edit\" data-css=\"tve-u-17667869d76\">\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbt3pyfd\" data-css=\"tve-u-17481b95e2d\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbt3pwhk\" data-css=\"tve-u-17667869d8d\">\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper tve_image_caption dynamic-group-kbt3pu4z\" data-css=\"tve-u-17667869d90\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/08\/deeplearning-course.jpg?resize=174%2C174&amp;ssl=1\" class=\"tve_image wp-image-5170\" alt=\"Deep Learning python\" data-id=\"5170\" width=\"174\" data-init-width=\"150\" height=\"174\" data-init-height=\"150\" title=\"deeplearning-course\" loading=\"lazy\" data-width=\"174\" data-height=\"174\" data-css=\"tve-u-17667869d91\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-5170\" alt=\"Deep Learning python\" data-id=\"5170\" width=\"174\" data-init-width=\"150\" height=\"174\" data-init-height=\"150\" title=\"deeplearning-course\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/08\/deeplearning-course.jpg?resize=174%2C174&amp;ssl=1\" data-width=\"174\" data-height=\"174\" data-css=\"tve-u-17667869d91\" data-recalc-dims=\"1\"><span class=\"tve-image-overlay\"><\/span><\/span><\/div>\n<h4 class=\"\" data-css=\"tve-u-17667869d78\">Machine Learning A to Z Course<\/h4>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbt3pyfd\" data-css=\"tve-u-17481b95e2d\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbt3pwhk\" data-css=\"tve-u-17667869d8e\">\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper tve_image_caption dynamic-group-kbt3pu4z\" data-css=\"tve-u-17667869d9d\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/08\/supervised-learning.png?resize=174%2C174&amp;ssl=1\" class=\"tve_image wp-image-4696\" alt=\"supervised learning\" data-id=\"4696\" width=\"174\" data-init-width=\"150\" height=\"174\" data-init-height=\"150\" title=\"supervised learning\" loading=\"lazy\" data-width=\"174\" data-height=\"174\" data-css=\"tve-u-17667869d9e\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-4696\" alt=\"supervised learning\" data-id=\"4696\" width=\"174\" data-init-width=\"150\" height=\"174\" data-init-height=\"150\" title=\"supervised learning\" loading=\"lazy\" src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/08\/supervised-learning.png?resize=174%2C174&amp;ssl=1\" data-width=\"174\" data-height=\"174\" data-css=\"tve-u-17667869d9e\" data-recalc-dims=\"1\"><span class=\"tve-image-overlay\"><\/span><\/span><\/div>\n<h4 class=\"\" data-css=\"tve-u-17667869d7f\">Complete Supervised Learning Algorithms<\/h4>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbt3pyfd\" data-css=\"tve-u-17481b95e2d\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbt3pwhk\" data-css=\"tve-u-17667869d8f\">\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper tve_image_caption dynamic-group-kbt3pu4z\" data-css=\"tve-u-17667869d9f\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/08\/datascience-spelization.jpg?resize=174%2C174&amp;ssl=1\" class=\"tve_image wp-image-4307\" alt=\"Data Science Full Specialization\" data-id=\"4307\" width=\"174\" data-init-width=\"150\" height=\"174\" data-init-height=\"150\" title=\"datascience spelization\" loading=\"lazy\" data-width=\"174\" data-height=\"174\" data-css=\"tve-u-17667869da0\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-4307\" alt=\"Data Science Full Specialization\" data-id=\"4307\" width=\"174\" data-init-width=\"150\" height=\"174\" data-init-height=\"150\" title=\"datascience spelization\" loading=\"lazy\" src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/08\/datascience-spelization.jpg?resize=174%2C174&amp;ssl=1\" data-width=\"174\" data-height=\"174\" data-css=\"tve-u-17667869da0\" data-recalc-dims=\"1\"><span class=\"tve-image-overlay\"><\/span><\/span><\/div>\n<h4 class=\"\" data-css=\"tve-u-17667869d87\">Python Data Science Specialization Course<\/h4>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/dataaspirant.com\/svm-kernels\/<\/p>\n","protected":false},"author":0,"featured_media":8014,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/posts\/8013"}],"collection":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/comments?post=8013"}],"version-history":[{"count":0,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/posts\/8013\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/media\/8014"}],"wp:attachment":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/media?parent=8013"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/categories?post=8013"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/tags?post=8013"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}