{"id":473,"date":"2016-04-24T23:58:25","date_gmt":"2016-04-24T21:58:25","guid":{"rendered":"http:\/\/tomaszkacmajor.pl\/?p=473"},"modified":"2020-05-17T16:30:56","modified_gmt":"2020-05-17T14:30:56","slug":"svm-model-selection","status":"publish","type":"post","link":"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/","title":{"rendered":"SVM model selection &#8211; how to adjust all these knobs pt. 1"},"content":{"rendered":"\n<p>This time we are going to discuss the influence of two basic variables on the quality of SVM classifier. They are called <em>hyperparameters<\/em> to distinguish them from the <em>parameters<\/em> optimized in a machine learning procedures. Two previous posts introduced <a href=\"http:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/17\/support-vector-machine\/\" target=\"_blank\" rel=\"noopener noreferrer\">Support Vector Machine<\/a> itself and <a href=\"http:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/data-preprocessing\/\" target=\"_blank\" rel=\"noopener noreferrer\">data preprocessing<\/a> for this classifier. As in other Machine Learning techniques there is also a need to properly adjust some system variables to find the best model for our needs. Here, we will focus on description of complexity parameter and gamma parameter from the Gaussian kernel. In the next article we will find an optimum SVM model for the foreground\/background estimation problem in <a href=\"http:\/\/tomaszkacmajor.pl\/index.php\/2016\/03\/19\/flover-project-4\/\" target=\"_blank\" rel=\"noopener noreferrer\">Flover<\/a> project using model validation techniques.<br><\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Complexity parameter<\/h2>\n\n\n\n<p>Let&#8217;s introduce the first hyperparameter of an SVM classifier. It defines its complexity and is also known as regularization or softness parameter indicated by <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-f34f74d98915e33f37a086f8cbfb996a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#67;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"14\" style=\"vertical-align: 0px;\"\/>. This value tells us how many points from the training set are allowed to be on the wrong side of the margin. SVM is always looking for the largest available margin between data groups. The margin is defined as a distance between decision hyperplane and the nearest point from a group, ie. the Support Vector. If all training data points are properly classified, the margin is usually relatively thin so it may be called a <strong>hard-margin<\/strong>. But we often deal with a set which is not linearly separable or have some outliers. Then, it&#8217;s better to <strong>soften<\/strong> the margin and allow for some misclassification in exchange to the grouping generalization. Below is the 2D example of two classes of points which are not linearly separable.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><a href=\"http:\/\/steve-cronin.blogspot.com\/2010\/09\/modern-analytics-look-at-smo.html\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/tomaszkacmajor.pl\/wp-content\/uploads\/2016\/04\/soft_margin-OK.gif\" alt=\"soft_margin OK\" class=\"wp-image-550\" width=\"536\" height=\"357\"\/><\/a><\/figure><\/div>\n\n\n\n<p>We see two red points which are inside the margin or even wrongly classified. How do we tell a classifier that we accept such soft-margin?<br>Decision hyperplane is defined by weigth vector <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-098fe4fc91886b0f8da407e07e59a15f_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#119;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"9\" width=\"15\" style=\"vertical-align: 0px;\"\/> and bias <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-621c319270a781c175d012493e69cbcc_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#98;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"11\" style=\"vertical-align: 0px;\"\/>. It&#8217;s composed from such <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-bcda923e732ff6e429d93d0fa7ea8a47_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#120;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"8\" width=\"11\" style=\"vertical-align: 0px;\"\/> points where <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-a5a9bc2367b38511c2977988aaa9b543_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;&#40;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#120;&#125;&#41;&#61;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#119;&#125;&#94;&#84;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#120;&#125;&#43;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#98;&#125;&#61;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"19\" width=\"161\" style=\"vertical-align: -4px;\"\/>. So, it&#8217;s simply dividing the plane into two regions. On one side <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-134eaf6699b049b6ec5b39cdbb4dd821_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;&#40;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#120;&#125;&#41;&#62;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"68\" style=\"vertical-align: -4px;\"\/>, on another side <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-91b178a4455b98a54f5367afddb4c760_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;&#40;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#120;&#125;&#41;&#60;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"68\" style=\"vertical-align: -4px;\"\/>. Now, to find the widest possible margin which have direct impact on a decision hyperplane the following cost function has to be minimized. Parameters <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-098fe4fc91886b0f8da407e07e59a15f_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#119;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"9\" width=\"15\" style=\"vertical-align: 0px;\"\/> and <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-621c319270a781c175d012493e69cbcc_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#98;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"11\" style=\"vertical-align: 0px;\"\/> are the searched variables but <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-621c319270a781c175d012493e69cbcc_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#98;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"11\" style=\"vertical-align: 0px;\"\/> comes in some further constraints which are not discussed here.<\/p>\n\n\n\n<p class=\"has-text-align-center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-820f9d306326e47786314d935fce6260_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#123;&#92;&#102;&#114;&#97;&#99;&#123;&#49;&#125;&#123;&#50;&#125;&#32;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#32;&#119;&#125;&#94;&#84;&#32;&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#32;&#119;&#125;&#43;&#32;&#123;&#67;&#125;&#32;&#92;&#115;&#117;&#109;&#95;&#123;&#105;&#61;&#49;&#125;&#94;&#123;&#108;&#125;&#32;&#92;&#120;&#105;&#95;&#105;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"23\" width=\"146\" style=\"vertical-align: -6px;\"\/><\/p>\n\n\n\n<p>The second term is a <strong>penalty of violating data<\/strong>. It takes all points which are on the wrong side of the margin and sums <em>slack variables<\/em> <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-f2bf95d4efb33615f2cb8c5372078fbe_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#120;&#105;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"13\" style=\"vertical-align: -4px;\"\/> assigned to them (<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-7248031445df3523a0a5584328259ed4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#48;&#92;&#108;&#101;&#113;&#92;&#120;&#105;&#95;&#105;&#92;&#108;&#101;&#113;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"77\" style=\"vertical-align: -4px;\"\/> &#8211; points located in the margin, <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-619e2e0dc45cfe03927d05c0fa73c918_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#120;&#105;&#95;&#105;&#62;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"45\" style=\"vertical-align: -4px;\"\/> &#8211; misclassified points). If the complexity parameter <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-f34f74d98915e33f37a086f8cbfb996a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#67;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"14\" style=\"vertical-align: 0px;\"\/> is high, we get a hard margin. Otherwise, if <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-f34f74d98915e33f37a086f8cbfb996a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#67;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"14\" style=\"vertical-align: 0px;\"\/> is close to <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-a5e437be25f29374d30f66cd46adf81c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"9\" style=\"vertical-align: 0px;\"\/>, the SVM margin is very soft and almost not caring about proper division of data. Therefore, the decision about the adequate complexity parameter is very important to obtain a good SVM model.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Gamma parameter<\/h2>\n\n\n\n<p>In many real-life cases a linear separation of our dataset is not efficient enough. Like presented in one of previous posts about <a href=\"http:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/17\/support-vector-machine\/\" target=\"_blank\" rel=\"noopener noreferrer\">SVM<\/a>, one can introduce a <strong>kernel<\/strong> functions which transforms the data into higher dimensions. Each of these kernels depend on their own parameters. It may be, for instance, a degree of a polynomial kernel or gamma\/sigma variable of one of the most popular kernel &#8211; a gaussian function. Let&#8217;s recall how the <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-4de02fc502ed5dbd15f371728ea270a3_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#103;&#97;&#109;&#109;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"10\" style=\"vertical-align: -4px;\"\/> parameter is influencing the width of a Gaussian.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/tomaszkacmajor.pl\/wp-content\/uploads\/2016\/04\/gaussian_curves.png\" alt=\"gaussian_curves\" class=\"wp-image-548\" width=\"371\" height=\"210\" srcset=\"https:\/\/tomaszkacmajor.pl\/wp-content\/uploads\/2016\/04\/gaussian_curves.png 495w, https:\/\/tomaszkacmajor.pl\/wp-content\/uploads\/2016\/04\/gaussian_curves-300x170.png 300w\" sizes=\"auto, (max-width: 371px) 100vw, 371px\" \/><\/figure><\/div>\n\n\n\n<div style=\"padding: 0px;\"><\/div>\n\n\n\n<p>It&#8217;s clear that the larger gamma the thinner gaussian curve is. Gaussian kernel in SVM is described as below<\/p>\n\n\n\n<p class=\"has-text-align-center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-7fb84ec05869efbe25c1681ea7c0ad4a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#123;&#107;&#40;&#92;&#116;&#101;&#120;&#116;&#98;&#102;&#123;&#120;&#125;&#44;&#92;&#116;&#101;&#120;&#116;&#98;&#102;&#123;&#120;&#39;&#125;&#41;&#61;&#32;&#101;&#94;&#123;&#45;&#32;&#92;&#103;&#97;&#109;&#109;&#97;&#32;&#92;&#124;&#32;&#92;&#116;&#101;&#120;&#116;&#98;&#102;&#123;&#120;&#125;&#32;&#45;&#32;&#92;&#116;&#101;&#120;&#116;&#98;&#102;&#123;&#120;&#39;&#125;&#32;&#92;&#124;&#32;&#94;&#50;&#125;&#32;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"21\" width=\"161\" style=\"vertical-align: -4px;\"\/><\/p>\n\n\n\n<p>Details of the <em>kernel trick<\/em> and other foundations of SVM theory are very well described in <a href=\"http:\/\/pyml.sourceforge.net\/doc\/howto.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">[7]<\/a>. In short, gaussian kerneling for a point <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-bcda923e732ff6e429d93d0fa7ea8a47_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#120;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"8\" width=\"11\" style=\"vertical-align: 0px;\"\/> consists in calculation of a sum of Gaussian &#8220;bumps&#8221; centered around each point <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-081ac66580bee413767eabf6f5745145_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#120;&#39;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"15\" style=\"vertical-align: 0px;\"\/> in a training dataset. When <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-4de02fc502ed5dbd15f371728ea270a3_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#103;&#97;&#109;&#109;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"10\" style=\"vertical-align: -4px;\"\/> is small a given data point <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-bcda923e732ff6e429d93d0fa7ea8a47_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#120;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"8\" width=\"11\" style=\"vertical-align: 0px;\"\/> has a non-zero kernel value relative to any point in the set. Therefore, the whole set of support vectors affects the value of the discriminant function at <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-bcda923e732ff6e429d93d0fa7ea8a47_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#97;&#116;&#104;&#98;&#102;&#123;&#120;&#125;\" title=\"Rendered by QuickLaTeX.com\" height=\"8\" width=\"11\" style=\"vertical-align: 0px;\"\/>, resulting in a smooth decision boundary. This situation is depicted on top-left panel below. As <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-4de02fc502ed5dbd15f371728ea270a3_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#103;&#97;&#109;&#109;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"10\" style=\"vertical-align: -4px;\"\/> is increased the locality of the support vector expansion increases, leading to <strong>greater curvature<\/strong> of the decision boundary. It can be observed on the last panel in the below example.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><a href=\"http:\/\/pyml.sourceforge.net\/doc\/howto.pdf\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/tomaszkacmajor.pl\/wp-content\/uploads\/2016\/04\/gaussian_gamma.png\" alt=\"gaussian_gamma\" class=\"wp-image-538\" width=\"565\" height=\"554\" srcset=\"https:\/\/tomaszkacmajor.pl\/wp-content\/uploads\/2016\/04\/gaussian_gamma.png 753w, https:\/\/tomaszkacmajor.pl\/wp-content\/uploads\/2016\/04\/gaussian_gamma-300x294.png 300w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>The most dangerous and common effect of increasing <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-4de02fc502ed5dbd15f371728ea270a3_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#103;&#97;&#109;&#109;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"10\" style=\"vertical-align: -4px;\"\/> is <strong>overfitting<\/strong>. It appears when the SVM model is extremely well trained for the training data. But it doesn&#8217;t generalize well, i.e. it&#8217;s not prepared to respond well for the new, unknown set of data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p>Two hyperparameters which decide about SVM model were presented. Complexity <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-f34f74d98915e33f37a086f8cbfb996a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#67;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"14\" style=\"vertical-align: 0px;\"\/> controls the softness of the decision margin. Gaussian kernel bandwidth <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tomaszkacmajor.pl\/wp-content\/ql-cache\/quicklatex.com-4de02fc502ed5dbd15f371728ea270a3_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#103;&#97;&#109;&#109;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"10\" style=\"vertical-align: -4px;\"\/> controls the curvature of a hyperplane. In the next post I will describe how to find them based on a specific SVM case.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>I strongly encourage you to play with these parameters <a href=\"http:\/\/www.csie.ntu.edu.tw\/~cjlin\/libsvm\/#GUI\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>. You can place some points in 2D space and group them using an SVM model with different parameters (-c for complexity and -g for gamma).<\/p><\/blockquote>\n\n\n\n<p>Sources:<br>1. Presentation &#8220;<a href=\"http:\/\/tdlc.ucsd.edu\/events\/boot_camp_2009\/tingfansvm.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">Practical guide to SVM<\/a>&#8221; by Tingfan Wu.<br>2. <a href=\"http:\/\/www.csie.ntu.edu.tw\/~cjlin\/libsvm\/#GUI\" target=\"_blank\" rel=\"noopener noreferrer\">SVM toy<\/a> based on libsvm library for Python.<br>3. SVM <a href=\"http:\/\/www.cs.columbia.edu\/~kathy\/cs4701\/documents\/jason_svm_tutorial.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">tutorial<\/a> by Jason Weston.<br>4. <a href=\"http:\/\/image.diku.dk\/shark\/sphinx_pages\/build\/html\/rest_sources\/tutorials\/algorithms\/svmModelSelection.html\" target=\"_blank\" rel=\"noopener noreferrer\">Documentation <\/a>of Shark Machine Learning library for C++.<br>5. <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/grid_search.html#grid-search\" target=\"_blank\" rel=\"noopener noreferrer\">Documentation <\/a>of scikit-learn library for Python.<br>6. Topic about SVM variables on <a href=\"http:\/\/stats.stackexchange.com\/questions\/108617\/what-do-the-variables-mean-in-the-svm-objective-function\" target=\"_blank\" rel=\"noopener noreferrer\">StackExchange<\/a>.<br>7. Ben-Hur, Weston &#8211; &#8220;<a href=\"http:\/\/pyml.sourceforge.net\/doc\/howto.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">A User\u2019s Guide to Support Vector Machines<\/a>&#8220;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This time we are going to discuss the influence of two basic variables on the quality of SVM classifier. They are called hyperparameters to distinguish them from the parameters optimized in a machine learning procedures. Two previous posts introduced Support Vector Machine itself and data preprocessing for this classifier. As in other Machine Learning techniques [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":526,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[17,12,11,14,15],"class_list":["post-473","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-flover-project","tag-cross-validation","tag-daj-sie-poznac","tag-flover","tag-machine-learning","tag-svm"],"blocksy_meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SVM model selection - how to adjust all these knobs pt. 1 - tomaszkacmajor.pl<\/title>\n<meta name=\"description\" content=\"Basic SVM parameters like complexity, gaussian kernel gamma are discussed in order to find the best SVM model for a given data.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SVM model selection - how to adjust all these knobs pt. 1 - tomaszkacmajor.pl\" \/>\n<meta property=\"og:description\" content=\"Basic SVM parameters like complexity, gaussian kernel gamma are discussed in order to find the best SVM model for a given data.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/\" \/>\n<meta property=\"og:site_name\" content=\"tomaszkacmajor.pl\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ProggBlogg\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-04-24T21:58:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-17T14:30:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/tomaszkacmajor.pl\/wp-content\/uploads\/2016\/04\/SVM-Model-Selection-Methods.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"tomasz.kacmajor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tkacmajor\" \/>\n<meta name=\"twitter:site\" content=\"@tkacmajor\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"tomasz.kacmajor\" \/>\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\":\"WebPage\",\"@id\":\"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/\",\"url\":\"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/\",\"name\":\"SVM model selection - how to adjust all these knobs pt. 1 - tomaszkacmajor.pl\",\"isPartOf\":{\"@id\":\"https:\/\/tomaszkacmajor.pl\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/tomaszkacmajor.pl\/wp-content\/uploads\/2016\/04\/SVM-Model-Selection-Methods.jpg\",\"datePublished\":\"2016-04-24T21:58:25+00:00\",\"dateModified\":\"2020-05-17T14:30:56+00:00\",\"author\":{\"@id\":\"https:\/\/tomaszkacmajor.pl\/#\/schema\/person\/5f40890309a32ae4f63fa6a284215b6c\"},\"description\":\"Basic SVM parameters like complexity, gaussian kernel gamma are discussed in order to find the best SVM model for a given data.\",\"breadcrumb\":{\"@id\":\"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/#primaryimage\",\"url\":\"https:\/\/tomaszkacmajor.pl\/wp-content\/uploads\/2016\/04\/SVM-Model-Selection-Methods.jpg\",\"contentUrl\":\"https:\/\/tomaszkacmajor.pl\/wp-content\/uploads\/2016\/04\/SVM-Model-Selection-Methods.jpg\",\"width\":2560,\"height\":1024},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Strona g\u0142\u00f3wna\",\"item\":\"https:\/\/tomaszkacmajor.pl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SVM model selection &#8211; how to adjust all these knobs pt. 1\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/tomaszkacmajor.pl\/#website\",\"url\":\"https:\/\/tomaszkacmajor.pl\/\",\"name\":\"tomaszkacmajor.pl\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/tomaszkacmajor.pl\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/tomaszkacmajor.pl\/#\/schema\/person\/5f40890309a32ae4f63fa6a284215b6c\",\"name\":\"tomasz.kacmajor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tomaszkacmajor.pl\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a1fe5c8a80549b9a680c7a6f9ea33a94?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a1fe5c8a80549b9a680c7a6f9ea33a94?s=96&d=mm&r=g\",\"caption\":\"tomasz.kacmajor\"},\"url\":\"https:\/\/tomaszkacmajor.pl\/index.php\/author\/tomasz-kacmajor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SVM model selection - how to adjust all these knobs pt. 1 - tomaszkacmajor.pl","description":"Basic SVM parameters like complexity, gaussian kernel gamma are discussed in order to find the best SVM model for a given data.","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:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/","og_locale":"en_US","og_type":"article","og_title":"SVM model selection - how to adjust all these knobs pt. 1 - tomaszkacmajor.pl","og_description":"Basic SVM parameters like complexity, gaussian kernel gamma are discussed in order to find the best SVM model for a given data.","og_url":"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/","og_site_name":"tomaszkacmajor.pl","article_publisher":"https:\/\/www.facebook.com\/ProggBlogg\/","article_published_time":"2016-04-24T21:58:25+00:00","article_modified_time":"2020-05-17T14:30:56+00:00","og_image":[{"width":2560,"height":1024,"url":"https:\/\/tomaszkacmajor.pl\/wp-content\/uploads\/2016\/04\/SVM-Model-Selection-Methods.jpg","type":"image\/jpeg"}],"author":"tomasz.kacmajor","twitter_card":"summary_large_image","twitter_creator":"@tkacmajor","twitter_site":"@tkacmajor","twitter_misc":{"Written by":"tomasz.kacmajor","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/","url":"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/","name":"SVM model selection - how to adjust all these knobs pt. 1 - tomaszkacmajor.pl","isPartOf":{"@id":"https:\/\/tomaszkacmajor.pl\/#website"},"primaryImageOfPage":{"@id":"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/#primaryimage"},"image":{"@id":"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/#primaryimage"},"thumbnailUrl":"https:\/\/tomaszkacmajor.pl\/wp-content\/uploads\/2016\/04\/SVM-Model-Selection-Methods.jpg","datePublished":"2016-04-24T21:58:25+00:00","dateModified":"2020-05-17T14:30:56+00:00","author":{"@id":"https:\/\/tomaszkacmajor.pl\/#\/schema\/person\/5f40890309a32ae4f63fa6a284215b6c"},"description":"Basic SVM parameters like complexity, gaussian kernel gamma are discussed in order to find the best SVM model for a given data.","breadcrumb":{"@id":"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/#primaryimage","url":"https:\/\/tomaszkacmajor.pl\/wp-content\/uploads\/2016\/04\/SVM-Model-Selection-Methods.jpg","contentUrl":"https:\/\/tomaszkacmajor.pl\/wp-content\/uploads\/2016\/04\/SVM-Model-Selection-Methods.jpg","width":2560,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/tomaszkacmajor.pl\/index.php\/2016\/04\/24\/svm-model-selection\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Strona g\u0142\u00f3wna","item":"https:\/\/tomaszkacmajor.pl\/"},{"@type":"ListItem","position":2,"name":"SVM model selection &#8211; how to adjust all these knobs pt. 1"}]},{"@type":"WebSite","@id":"https:\/\/tomaszkacmajor.pl\/#website","url":"https:\/\/tomaszkacmajor.pl\/","name":"tomaszkacmajor.pl","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/tomaszkacmajor.pl\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/tomaszkacmajor.pl\/#\/schema\/person\/5f40890309a32ae4f63fa6a284215b6c","name":"tomasz.kacmajor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tomaszkacmajor.pl\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a1fe5c8a80549b9a680c7a6f9ea33a94?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a1fe5c8a80549b9a680c7a6f9ea33a94?s=96&d=mm&r=g","caption":"tomasz.kacmajor"},"url":"https:\/\/tomaszkacmajor.pl\/index.php\/author\/tomasz-kacmajor\/"}]}},"_links":{"self":[{"href":"https:\/\/tomaszkacmajor.pl\/index.php\/wp-json\/wp\/v2\/posts\/473","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tomaszkacmajor.pl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tomaszkacmajor.pl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tomaszkacmajor.pl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tomaszkacmajor.pl\/index.php\/wp-json\/wp\/v2\/comments?post=473"}],"version-history":[{"count":21,"href":"https:\/\/tomaszkacmajor.pl\/index.php\/wp-json\/wp\/v2\/posts\/473\/revisions"}],"predecessor-version":[{"id":1711,"href":"https:\/\/tomaszkacmajor.pl\/index.php\/wp-json\/wp\/v2\/posts\/473\/revisions\/1711"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tomaszkacmajor.pl\/index.php\/wp-json\/wp\/v2\/media\/526"}],"wp:attachment":[{"href":"https:\/\/tomaszkacmajor.pl\/index.php\/wp-json\/wp\/v2\/media?parent=473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tomaszkacmajor.pl\/index.php\/wp-json\/wp\/v2\/categories?post=473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tomaszkacmajor.pl\/index.php\/wp-json\/wp\/v2\/tags?post=473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}