{"id":8213,"date":"2018-12-26T15:36:44","date_gmt":"2018-12-26T10:06:44","guid":{"rendered":"http:\/\/ivyproschool.com\/blog\/?p=8213"},"modified":"2021-06-22T19:05:38","modified_gmt":"2021-06-22T13:35:38","slug":"implementation-of-support-vector-machines-in-r","status":"publish","type":"post","link":"https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/","title":{"rendered":"Implementation of Support Vector Machines in R"},"content":{"rendered":"<p><a href=\"https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/\"><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8218\" src=\"https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/svm.png\" alt=\"\" width=\"560\" height=\"315\" srcset=\"https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/svm.png 560w, https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/svm-300x169.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><\/p>\n<p>We discussed in\u00a0our previous article &#8216;<a href=\"https:\/\/ivyproschool.com\/blog\/2018\/12\/14\/beginners-guide-to-support-vector-machines\/\">Beginners guide to SVM<\/a>&#8216;\u00a0 the concept and the basics that one needs to know to learn Support Vector Machines.<\/p>\n<p>Now lets talk about how to implement it in <a href=\"https:\/\/ivyproschool.com\/our-courses\/big-data-and-analytics\/predictive-analytics-with-r-certification\/\" rel=\"noopener noreferrer\" target=\"_blank\">R<\/a>. Explaining it by a simple hands-on example as below-<\/p>\n<p>The data set we have used here is called <strong>iris<\/strong>. It is already present in the R studio and it is mainly used for practising binary classification problems.<\/p>\n<p>Saving the values of the predictor variables in x<\/p>\n<p><strong>x &lt;- subset (iris, select=-Species)<\/strong><\/p>\n<p><strong>\u00a0<\/strong>Saving the values of the dependent variable<strong> Species<\/strong> in<strong> Y <\/strong><\/p>\n<p><strong>y &lt;- iris$Species<\/strong><\/p>\n<p>The package <strong>e1071 <\/strong>should be installed by the given code:<strong> install.packages (\u201ce1071\u201d).<\/strong><\/p>\n<p>We call the package before using the functions available in them.<\/p>\n<p><strong>library (e1071)<\/strong><\/p>\n<p><strong>\u00a0<\/strong>Saving the svm model in<strong> svm_model<\/strong><\/p>\n<p><strong>svm_model &lt;- svm (Species ~., data=iris)<\/strong><\/p>\n<p><strong>\u00a0<\/strong>The summary of the model shows the default values of the parameters of svm.<\/p>\n<p><strong>summary (svm_model)<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8214\" src=\"https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/SVM-implementation-1.png\" alt=\"\" width=\"630\" height=\"243\" srcset=\"https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/SVM-implementation-1.png 630w, https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/SVM-implementation-1-300x116.png 300w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/p>\n<p>Now we predict the values of y with function<strong> predict () <\/strong>and save it in<strong> pred1.<\/strong><\/p>\n<p><strong>pred1 &lt;- predict (svm_model, x)<\/strong><\/p>\n<p><strong>\u00a0<\/strong><strong>confusionMatrix ()<\/strong> function is available in<strong> caret<\/strong> package and it is used to see the accuracy of the model by comparing the predicted values with the original values .We find from\u00a0 the summary below that , we have achieved an accuracy of <strong>97.33 %<\/strong> and there is misclassification in both <strong>versicolor <\/strong>and <strong>virginica<\/strong>.<\/p>\n<p><strong>library (caret)<\/strong><\/p>\n<p><strong>confusionMatrix (pred1, y)<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8215\" src=\"https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/SVM-implementation-2.png\" alt=\"\" width=\"663\" height=\"445\" srcset=\"https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/SVM-implementation-2.png 663w, https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/SVM-implementation-2-300x201.png 300w\" sizes=\"auto, (max-width: 663px) 100vw, 663px\" \/><\/p>\n<p><strong>PARAMETERS TUNING<\/strong><\/p>\n<p><strong>TYPE<\/strong><\/p>\n<p>SVM models can be classified into four distinct groups:<\/p>\n<ul>\n<li>c- classification<\/li>\n<li>nu- classification<\/li>\n<li>epsilon- regression<\/li>\n<li>nu- regression<\/li>\n<\/ul>\n<p><strong>C<\/strong> and <strong>nu<\/strong> regularization parameters help in implementing a penalty on the errors that are performed while separating the classes. This helps in improving the accuracy of the output.<strong> C<\/strong> ranges from (<strong>0 to infinity)<\/strong> that can be a bit hard to estimate and use. A better modification of this is <strong>nu<\/strong> which operates between (<strong>0-1)<\/strong> and the advantage of using <strong>nu<\/strong> is that it has a control over the number of support vectors.<\/p>\n<p><strong>Kernel<\/strong><\/p>\n<p>Kernel parameter selects the type of hyperplane used to separate the data. The \u2018linear\u2019 kernel uses a linear hyperplane. While the \u2018radial\u2019 and \u2018polynomial\u2019 is used for non linear hyper-plane.<\/p>\n<p>The best way to determine the kernel is to check which kernel works well for the data. The linear kernel will work fine if the dataset is linearly separable; however, if the dataset is not linearly separable, a linear kernel will lead to high amount of misclassifications.<\/p>\n<p>The radial kernel decision boundary is also linear. But the difference between both the kernels is that, the radial kernel actually creates <strong>non-linear combinations of features<\/strong> to uplift the samples onto a <strong>higher-dimensional feature space<\/strong> where one can use a linear decision boundary to separate the classes.<\/p>\n<p>Now another question is, what if both a linear and a nonlinear kernel works equally well on a dataset?<\/p>\n<p>So in that case we choose the simpler linear SVM because firstly linear kernel is a parametric model, secondly the complexity of the radial kernel grows with the size of the training set. So it is more expensive to train a radial kernel.<\/p>\n<p><strong>Gamma<\/strong><\/p>\n<p>Gamma is a parameter for non linear hyperplanes. The higher the gamma values the more it tries to exactly fit the training data set. When\u00a0gamma\u00a0is <strong>very small<\/strong>, the model cannot capture the complexity the data. The region of influence of any selected support vector would include the whole training data set i.e. points far away from the separation line. Whereas when gamma\u00a0is <strong>too large<\/strong>, the radius of the area of influence of the support vectors only includes the support vector close to the separation line. But sometimes very high gamma values lead to overfitting the training data. So choosing gamma values at an intermediate level is\u00a0\u00a0 always desirable.<\/p>\n<p><strong>Cost<\/strong><\/p>\n<p>Cost controls the tradeoff between the length of a decision boundary and accuracy of the model. It tells the SVM how much misclassification to avoid. Now for large values of cost, there will be a smaller margin hyperplane which does a better job of getting all the training points classified correctly. On the other hand, a smaller value of cost leads to larger-margin hyperplanes which misclassifies more points.<\/p>\n<p><strong>Degree<\/strong><\/p>\n<p>Degree is a parameter that is used when kernel is set to \u2018polynomial\u2019. It is the degree of the polynomial used to find the hyperplane to split the data.<\/p>\n<p><strong>\u00a0<\/strong>Now we use the function<strong> tune () <\/strong>to get the best values of the parameters for the given dataset.<\/p>\n<p><strong>svm_tune &lt;- tune (svm, train.x=x, train.y=y, <\/strong><\/p>\n<p><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 kernel=&#8221;radial&#8221;, ranges=list(cost=c(0.1,1,10,100,1000), gamma=c(0.1,1,10,100)))<\/strong><\/p>\n<p><strong>\u00a0<\/strong>So after printing <strong>svm_tune<\/strong> we get that the best value for <strong>cost<\/strong> is <strong>10<\/strong> and <strong>gamma<\/strong> is <strong>0.1<\/strong><\/p>\n<p><strong>print (svm_tune)<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8216\" src=\"https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/SVM-implementation-3.png\" alt=\"\" width=\"628\" height=\"157\" srcset=\"https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/SVM-implementation-3.png 628w, https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/SVM-implementation-3-300x75.png 300w\" sizes=\"auto, (max-width: 628px) 100vw, 628px\" \/><\/p>\n<p>We save the tuned model in<strong> svm_model_after_tune<\/strong><\/p>\n<p><strong>svm_model_after_tune &lt;- svm (Species ~., data=iris, kernel=&#8221;radial&#8221;, cost=1, gamma=0.1)<\/strong><\/p>\n<p><strong>\u00a0<\/strong>Predicting the values of y with function<strong> predict () <\/strong>and saving it in<strong> pred2.<\/strong><\/p>\n<p><strong>pred2 &lt;- predict (svm_model_after_tune, x)<\/strong><\/p>\n<p><strong>\u00a0<\/strong>From the updated confusion matrix and accuracy of the model (given below) it is clear that ,the model has improved after a bit of parameter tuning . The accuracy is now <strong>98% <\/strong>and the misclassification is confined to <strong>virginica<\/strong> .<\/p>\n<p><strong>confusionMatrix (pred2, y)<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8217\" src=\"https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/SVM-implementation-4.png\" alt=\"\" width=\"626\" height=\"417\" srcset=\"https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/SVM-implementation-4.png 626w, https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/SVM-implementation-4-300x200.png 300w, https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/SVM-implementation-4-450x300.png 450w\" sizes=\"auto, (max-width: 626px) 100vw, 626px\" \/><\/p>\n<p>Parameters tuning does not end here. There are a lot of features of the <strong>svm ()<\/strong> function. For more information click the links given below:<\/p>\n<ol>\n<li><a href=\"https:\/\/www.rdocumentation.org\/packages\/e1071\/versions\/1.7-0\/topics\/svm\">https:\/\/www.rdocumentation.org\/packages\/e1071\/versions\/1.7-0\/topics\/svm<\/a><\/li>\n<li><a href=\"https:\/\/www.rdocumentation.org\/packages\/e1071\/versions\/1.7-0\/topics\/tune\">https:\/\/www.rdocumentation.org\/packages\/e1071\/versions\/1.7-0\/topics\/tune<\/a><\/li>\n<\/ol>\n<p>You can also use the svm algorithm from the <strong>caret<\/strong> package .Here is the link to the functions available in <strong>caret <\/strong>package.<\/p>\n<p><a href=\"http:\/\/topepo.github.io\/caret\/train-models-by-tag.html#support-vector-machines\">http:\/\/topepo.github.io\/caret\/train-models-by-tag.html#support-vector-machines<\/a><\/p>\n<p><b><\/b>SVM is a very useful technique in case of<strong> nonlinear<\/strong> and <strong>high dimensional data<\/strong>. But there are some drawbacks. Firstly, it is very <strong>complex<\/strong> and people prefer to use simpler and easily interpretable models. Secondly, the <strong>correct choice of kernel parameters is crucial<\/strong> for obtaining good results, which means that an extensive research must be conducted on the parameters before using the model. Furthermore, a tuned model may give excellent result in classification accuracy for a problem A, but may result in poor classification accuracy for a problem B.<\/p>\n<p><em>This article has been contributed by our student Saptarshi Mukherjee.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We discussed in\u00a0our previous article &#8216;Beginners guide to SVM&#8216;\u00a0 the concept and the basics that one needs to know to learn Support Vector Machines. Now lets talk about how to implement it in R. Explaining it by a simple hands-on example as below- The data set we have used here is called iris. It is already present in the R studio and it is mainly used for practising binary classification problems. Saving the values of the predictor variables in x x &lt;- subset (iris, select=-Species) \u00a0Saving the values of the dependent variable Species in Y y &lt;- iris$Species The package e1071 should be installed by the given code: install.packages (\u201ce1071\u201d). We call the package before using the functions available in them. library (e1071) \u00a0Saving the svm model in svm_model svm_model &lt;- svm (Species ~., data=iris) \u00a0The summary of the model shows the default values of the parameters of svm. summary (svm_model) Now we predict the values of y with function predict () and save it in pred1. pred1 &lt;- predict (svm_model, x) \u00a0confusionMatrix () function is available in caret package and it is used to see the accuracy of the model by comparing the predicted values with the original values [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":8218,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[851,5,881,715],"tags":[56,76,467,728,504,369],"class_list":["post-8213","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-business-analytics","category-data-analytics","category-data-science","category-machine-learning-ai","tag-big-data-analytics","tag-business-analytics","tag-data-science","tag-data-science-career","tag-machine-learning","tag-r"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Implementation of Support Vector Machines in R | Ivy Pro School<\/title>\n<meta name=\"description\" content=\"In this blog, We will discuss the implementation of support vector machines in R. Learn and Grow with Ivy Pro School. Read More here.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Implementation of Support Vector Machines in R | Ivy Pro School\" \/>\n<meta property=\"og:description\" content=\"In this blog, We will discuss the implementation of support vector machines in R. Learn and Grow with Ivy Pro School. Read More here.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/\" \/>\n<meta property=\"og:site_name\" content=\"R vs Python: Which Analytics Tool Should You Choose for Data Science?\" \/>\n<meta property=\"article:author\" content=\"https:\/\/facebook.com\/ivyproschool\" \/>\n<meta property=\"article:published_time\" content=\"2018-12-26T10:06:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-22T13:35:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/svm.png\" \/>\n\t<meta property=\"og:image:width\" content=\"560\" \/>\n\t<meta property=\"og:image:height\" content=\"315\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ivy Professional School\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ivyproschool\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ivy Professional School\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/implementation-of-support-vector-machines-in-r\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/implementation-of-support-vector-machines-in-r\\\/\"},\"author\":{\"name\":\"Ivy Professional School\",\"@id\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/#\\\/schema\\\/person\\\/31fdab8559dd3db99173764bfb60215d\"},\"headline\":\"Implementation of Support Vector Machines in R\",\"datePublished\":\"2018-12-26T10:06:44+00:00\",\"dateModified\":\"2021-06-22T13:35:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/implementation-of-support-vector-machines-in-r\\\/\"},\"wordCount\":1053,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/implementation-of-support-vector-machines-in-r\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/08\\\/svm.png\",\"keywords\":[\"Big Data analytics\",\"business analytics\",\"data science\",\"data science career\",\"machine learning\",\"R\"],\"articleSection\":[\"Business Analytics\",\"Data Analytics\",\"Data Science\",\"Machine Learning &amp; AI\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/implementation-of-support-vector-machines-in-r\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/implementation-of-support-vector-machines-in-r\\\/\",\"url\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/implementation-of-support-vector-machines-in-r\\\/\",\"name\":\"Implementation of Support Vector Machines in R | Ivy Pro School\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/implementation-of-support-vector-machines-in-r\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/implementation-of-support-vector-machines-in-r\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/08\\\/svm.png\",\"datePublished\":\"2018-12-26T10:06:44+00:00\",\"dateModified\":\"2021-06-22T13:35:38+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/#\\\/schema\\\/person\\\/31fdab8559dd3db99173764bfb60215d\"},\"description\":\"In this blog, We will discuss the implementation of support vector machines in R. Learn and Grow with Ivy Pro School. Read More here.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/implementation-of-support-vector-machines-in-r\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/implementation-of-support-vector-machines-in-r\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/implementation-of-support-vector-machines-in-r\\\/#primaryimage\",\"url\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/08\\\/svm.png\",\"contentUrl\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/08\\\/svm.png\",\"width\":560,\"height\":315,\"caption\":\"Support Vector Machines - Ivy Pro School\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/implementation-of-support-vector-machines-in-r\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Implementation of Support Vector Machines in R\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/\",\"name\":\"Ivy Professional School | Official Blog\",\"description\":\"Confused between R and Python for your data science journey? Discover the key differences in data visualization, handling capabilities, speed, and ease of learning.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/#\\\/schema\\\/person\\\/31fdab8559dd3db99173764bfb60215d\",\"name\":\"Ivy Professional School\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/866b09293f13d461b399bb9a40607e85623ede13d844f763bf665689cb0d1452?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/866b09293f13d461b399bb9a40607e85623ede13d844f763bf665689cb0d1452?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/866b09293f13d461b399bb9a40607e85623ede13d844f763bf665689cb0d1452?s=96&d=mm&r=g\",\"caption\":\"Ivy Professional School\"},\"sameAs\":[\"http:\\\/\\\/www.ivyproschool.com\",\"https:\\\/\\\/facebook.com\\\/ivyproschool\",\"https:\\\/\\\/instagram.com\\\/ivyproschool\",\"https:\\\/\\\/x.com\\\/ivyproschool\",\"https:\\\/\\\/youtube.com\\\/ivyproschool\"],\"url\":\"https:\\\/\\\/ivyproschool.com\\\/blog\\\/author\\\/prateek\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Implementation of Support Vector Machines in R | Ivy Pro School","description":"In this blog, We will discuss the implementation of support vector machines in R. Learn and Grow with Ivy Pro School. Read More here.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/","og_locale":"en_US","og_type":"article","og_title":"Implementation of Support Vector Machines in R | Ivy Pro School","og_description":"In this blog, We will discuss the implementation of support vector machines in R. Learn and Grow with Ivy Pro School. Read More here.","og_url":"https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/","og_site_name":"R vs Python: Which Analytics Tool Should You Choose for Data Science?","article_author":"https:\/\/facebook.com\/ivyproschool","article_published_time":"2018-12-26T10:06:44+00:00","article_modified_time":"2021-06-22T13:35:38+00:00","og_image":[{"width":560,"height":315,"url":"https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/svm.png","type":"image\/png"}],"author":"Ivy Professional School","twitter_card":"summary_large_image","twitter_creator":"@ivyproschool","twitter_misc":{"Written by":"Ivy Professional School","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/#article","isPartOf":{"@id":"https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/"},"author":{"name":"Ivy Professional School","@id":"https:\/\/ivyproschool.com\/blog\/#\/schema\/person\/31fdab8559dd3db99173764bfb60215d"},"headline":"Implementation of Support Vector Machines in R","datePublished":"2018-12-26T10:06:44+00:00","dateModified":"2021-06-22T13:35:38+00:00","mainEntityOfPage":{"@id":"https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/"},"wordCount":1053,"commentCount":0,"image":{"@id":"https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/#primaryimage"},"thumbnailUrl":"https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/svm.png","keywords":["Big Data analytics","business analytics","data science","data science career","machine learning","R"],"articleSection":["Business Analytics","Data Analytics","Data Science","Machine Learning &amp; AI"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/","url":"https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/","name":"Implementation of Support Vector Machines in R | Ivy Pro School","isPartOf":{"@id":"https:\/\/ivyproschool.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/#primaryimage"},"image":{"@id":"https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/#primaryimage"},"thumbnailUrl":"https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/svm.png","datePublished":"2018-12-26T10:06:44+00:00","dateModified":"2021-06-22T13:35:38+00:00","author":{"@id":"https:\/\/ivyproschool.com\/blog\/#\/schema\/person\/31fdab8559dd3db99173764bfb60215d"},"description":"In this blog, We will discuss the implementation of support vector machines in R. Learn and Grow with Ivy Pro School. Read More here.","breadcrumb":{"@id":"https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/#primaryimage","url":"https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/svm.png","contentUrl":"https:\/\/ivyproschool.com\/blog\/wp-content\/uploads\/2015\/08\/svm.png","width":560,"height":315,"caption":"Support Vector Machines - Ivy Pro School"},{"@type":"BreadcrumbList","@id":"https:\/\/ivyproschool.com\/blog\/implementation-of-support-vector-machines-in-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ivyproschool.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Implementation of Support Vector Machines in R"}]},{"@type":"WebSite","@id":"https:\/\/ivyproschool.com\/blog\/#website","url":"https:\/\/ivyproschool.com\/blog\/","name":"Ivy Professional School | Official Blog","description":"Confused between R and Python for your data science journey? Discover the key differences in data visualization, handling capabilities, speed, and ease of learning.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ivyproschool.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ivyproschool.com\/blog\/#\/schema\/person\/31fdab8559dd3db99173764bfb60215d","name":"Ivy Professional School","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/866b09293f13d461b399bb9a40607e85623ede13d844f763bf665689cb0d1452?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/866b09293f13d461b399bb9a40607e85623ede13d844f763bf665689cb0d1452?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/866b09293f13d461b399bb9a40607e85623ede13d844f763bf665689cb0d1452?s=96&d=mm&r=g","caption":"Ivy Professional School"},"sameAs":["http:\/\/www.ivyproschool.com","https:\/\/facebook.com\/ivyproschool","https:\/\/instagram.com\/ivyproschool","https:\/\/x.com\/ivyproschool","https:\/\/youtube.com\/ivyproschool"],"url":"https:\/\/ivyproschool.com\/blog\/author\/prateek\/"}]}},"_links":{"self":[{"href":"https:\/\/ivyproschool.com\/blog\/wp-json\/wp\/v2\/posts\/8213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ivyproschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ivyproschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ivyproschool.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/ivyproschool.com\/blog\/wp-json\/wp\/v2\/comments?post=8213"}],"version-history":[{"count":3,"href":"https:\/\/ivyproschool.com\/blog\/wp-json\/wp\/v2\/posts\/8213\/revisions"}],"predecessor-version":[{"id":10697,"href":"https:\/\/ivyproschool.com\/blog\/wp-json\/wp\/v2\/posts\/8213\/revisions\/10697"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ivyproschool.com\/blog\/wp-json\/wp\/v2\/media\/8218"}],"wp:attachment":[{"href":"https:\/\/ivyproschool.com\/blog\/wp-json\/wp\/v2\/media?parent=8213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ivyproschool.com\/blog\/wp-json\/wp\/v2\/categories?post=8213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ivyproschool.com\/blog\/wp-json\/wp\/v2\/tags?post=8213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}