{"id":4797,"date":"2020-02-15T11:30:32","date_gmt":"2020-02-15T11:30:32","guid":{"rendered":"https:\/\/prwatech.in\/blog\/?p=4797"},"modified":"2026-10-15T16:05:21","modified_gmt":"2026-10-15T16:05:21","slug":"support-vector-machine-tutorial-for-beginners","status":"publish","type":"post","link":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/","title":{"rendered":"Support Vector Machine Tutorial"},"content":{"rendered":"<h1><strong><b>Support Vector Machine Tutorial for Beginners<\/b><\/strong><\/h1>\n<p>Imagine two groups of houses on opposite sides of a river, and you need to draw a fence that separates them. You could draw it anywhere in the gap, but some fences are better than others. A fence that hugs one group is risky, because a new house built a little off the pattern ends up on the wrong side. The safest fence runs down the middle of the widest empty space. That is the whole idea behind the support vector machine.<\/p>\n<p>A support vector machine, or SVM, is a supervised learning algorithm used mainly for classification. It looks for the boundary that separates classes with the largest possible gap on both sides. That gap is called the margin, and the data points that touch it are called support vectors. A wide margin gives a model that tends to cope well with new data, which is why SVMs became one of the most trusted algorithms for problems with small and medium sized datasets and many features, such as text and gene data.<\/p>\n<p>This tutorial starts from the plain picture and builds up. You will learn what a hyperplane is, how the margin and the support vectors work, and how SVM chooses between several possible boundaries. Then comes the part that makes SVM powerful: the kernel trick, which lets it separate data that no straight line can divide. We cover the two settings that matter most, C and gamma, and finish with a complete Python program using scikit learn that was run and checked, plus common mistakes and a short FAQ.<\/p>\n<h2><strong><b>What is a Support Vector Machine?<\/b><\/strong><\/h2>\n<p>In a two class problem, SVM finds a boundary between the classes. With two features, that boundary is a line. With three features it is a flat plane. With more features it is called a <strong><b>hyperplane<\/b><\/strong>, which is simply the same idea in higher dimensions. A new point is classified by which side of the hyperplane it falls on.<\/p>\n<p>Many hyperplanes can separate the same data. SVM picks the one with the <strong><b>maximum margin<\/b><\/strong>, meaning the largest distance to the nearest point of each class.<\/p>\n<h2><strong><b>What are Support Vectors?<\/b><\/strong><\/h2>\n<p>Support vectors are the training points closest to the boundary. They sit right on the edge of the margin, and they alone decide where the hyperplane goes. If you removed every other point, the boundary would not move. If you moved a support vector, the boundary would shift.<\/p>\n<p>This is a useful property. SVM does not need to remember all the data, only the handful of points that matter. In the program later in this tutorial, a model trained on 210 points needed only 67 support vectors.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4798\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm1.png\" alt=\"Support Vector Machine Tutorial for Beginners - Introduction\" width=\"850\" height=\"618\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm1.png 589w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm1-300x218.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h2><strong><b>How Does SVM Work?<\/b><\/strong><\/h2>\n<p>The process has a simple logic, which we can follow in four steps.<\/p>\n<ol>\n<li><b><\/b><strong><b>Draw candidate boundaries. <\/b><\/strong>Many lines could split the classes.<\/li>\n<li><b><\/b><strong><b>Measure the margin of each. <\/b><\/strong>The margin is the distance from the boundary to the nearest point on either side.<\/li>\n<li><b><\/b><strong><b>Pick the widest. <\/b><\/strong>The boundary with the largest margin is chosen.<\/li>\n<li><b><\/b><strong><b>Classify new points. <\/b><\/strong>Each new point is labelled by the side of the boundary it lands on.<\/li>\n<\/ol>\n<h2><strong><b>How to Choose the Right Hyperplane?<\/b><\/strong><\/h2>\n<p>When the choice is not obvious, these five situations show how SVM reasons. Each one has a picture on the original page, which stays in place below.<\/p>\n<h3><strong><b>Criterion 1: Pick the Hyperplane That Separates the Classes Better<\/b><\/strong><\/h3>\n<p>If several lines are candidates, the one that splits the two classes more cleanly is the better choice. A line that leaves points of both classes on one side is clearly worse than a line that keeps each class on its own side.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4799\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm2.png\" alt=\"Support Vector Machine Tutorial for Beginners - Criterion 1\" width=\"850\" height=\"618\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm2.png 589w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm2-300x218.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3><strong><b>Criterion 2: Maximise the Distance to the Nearest Points<\/b><\/strong><\/h3>\n<p>When more than one line separates the classes correctly, choose the one with the largest distance to the nearest point of each class. This distance is the margin. A larger margin means more room for error, so the boundary is more likely to hold up on new data.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4800\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm3.png\" alt=\"Support Vector Machine Tutorial for Beginners - Criterion 2\" width=\"850\" height=\"627\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm3.png 644w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm3-300x221.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3><strong><b>Criterion 3: Classify Correctly Before You Maximise the Margin<\/b><\/strong><\/h3>\n<p>A wider margin is not worth it if it misclassifies points. SVM puts correct classification first. It looks for the widest margin only among boundaries that already separate the data well.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4801\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm3-1.png\" alt=\"Support Vector Machine Tutorial for Beginners - Criterion 3\" width=\"850\" height=\"627\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm3-1.png 644w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm3-1-300x221.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3><strong><b>Criterion 4: Ignore Outliers When the Data Has Them<\/b><\/strong><\/h3>\n<p>Sometimes a single point sits deep inside the other class. A strict boundary would twist itself to catch that point and end up with a tiny margin. SVM can treat such a point as an outlier and ignore it, which keeps the boundary simple and the margin wide. How strict it is about this is controlled by the setting called C, covered below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4802\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM4.png\" alt=\"Support Vector Machine Tutorial for Beginners - Criterion 4\" width=\"850\" height=\"658\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM4.png 603w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM4-300x232.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3><strong><b>Criterion 5: Add a Dimension When No Straight Line Works<\/b><\/strong><\/h3>\n<p>Some data cannot be split by any straight line, for example one class forming a ring around the other. In that case SVM adds a new feature to lift the points into a higher dimension, where a flat boundary can separate them. This is the idea of the kernel trick, explained next.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4803\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM5.png\" alt=\"Support Vector Machine Tutorial for Beginners - Criterion 5\" width=\"850\" height=\"638\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM5.png 497w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM5-300x225.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h2><strong><b>The Kernel Trick in Plain Words<\/b><\/strong><\/h2>\n<p>Take points where one class sits near the center and the other forms a ring around it. No line can separate them on a flat page. Now add a third value for each point, z = x squared plus y squared, which is the squared distance from the center. The inner points get small z values and the outer points get large ones. In three dimensions, a flat sheet at the right height splits them cleanly.<\/p>\n<p style=\"text-align: center;\">z = x^2+y^2<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4804\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM6.png\" alt=\"S V M Tutorial example\" width=\"850\" height=\"769\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM6.png 516w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM6-300x272.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p>Computing new features for every point can be expensive. The <strong><b>kernel trick<\/b><\/strong>\u00a0gets the same result without ever building the new features. A kernel function measures how similar two points are as if they were in the higher dimension, and the algorithm needs only that similarity. This is why SVM can work with very complex boundaries at a reasonable cost.<\/p>\n<h2><strong><b>Tuning Parameters of SVM<\/b><\/strong><\/h2>\n<h3><strong><b>Kernel<\/b><\/strong><\/h3>\n<p>The kernel decides the shape of the boundary. These are the four built in options in scikit learn.<\/p>\n<div style=\"border: 1px solid #d9e0ea; border-radius: 8px; overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch;\">\n<table style=\"width: 100%; min-width: 760px; border-collapse: collapse; font-family: Arial,Helvetica,sans-serif; font-size: 16px; line-height: 1.6; color: #1f2937;\">\n<caption style=\"caption-side: top; text-align: left; padding: 14px 16px; font-weight: bold; font-size: 17px; color: #0f2a4a;\">SVM kernels compared<\/caption>\n<thead>\n<tr>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 120px;\" scope=\"col\">Kernel<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 340px;\" scope=\"col\">What it does<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Use it when<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">linear<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">A straight line or flat plane<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Data is roughly separable by a line, or you have many features, as in text<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">poly<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">A curved boundary of a chosen degree. The formula is gamma times the dot product of the points, plus a constant r, all raised to the power d<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">You expect interactions between features. Slower, and the degree needs tuning<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">rbf<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">A smooth, flexible curve. Similarity falls with distance, as exp of minus gamma times the squared distance between points<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">The safe default when you do not know the shape of the data<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">sigmoid<\/th>\n<td style=\"padding: 12px 16px;\">Based on the tanh function, like a small neural network unit<\/td>\n<td style=\"padding: 12px 16px;\">Rarely. It can behave poorly, so try rbf first<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<p>In practice, start with linear to get a baseline, then try rbf. Choose between them on validation data, not by guess.<\/p>\n<h3><strong><b>Regularization: The C Parameter<\/b><\/strong><\/h3>\n<p>C controls how much SVM is punished for misclassifying training points. It is the balance between a wide margin and a perfect fit.<\/p>\n<ul>\n<li><b><\/b><strong><b>Low C<\/b><\/strong>accepts a few mistakes in return for a wider, smoother boundary.<\/li>\n<li><b><\/b><strong><b>High C<\/b><\/strong>tries hard to classify every training point correctly, which gives a narrower margin and a twisted boundary that can overfit.<\/li>\n<\/ul>\n<p>The default in scikit learn is 1. Think of C as how strictly the model is graded on its training data.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4805\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM8.png\" alt=\"S V M Tutorial for Beginners - Regularization\" width=\"850\" height=\"616\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM8.png 446w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM8-300x217.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4806\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM9.png\" alt=\"S V M Tutorial for Beginners - Regularization example\" width=\"850\" height=\"659\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM9.png 458w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM9-300x233.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3><strong><b>Gamma<\/b><\/strong><\/h3>\n<p>Gamma applies to the rbf, poly and sigmoid kernels. It sets how far the influence of a single training point reaches.<\/p>\n<ul>\n<li><b><\/b><strong><b>Low gamma<\/b><\/strong>means each point has a far reaching influence, so the boundary is smooth and simple.<\/li>\n<li><b><\/b><strong><b>High gamma<\/b><\/strong>means each point only affects its close neighbours, so the boundary wraps tightly around individual points and can overfit.<\/li>\n<\/ul>\n<h3><strong><b>Margin<\/b><\/strong><\/h3>\n<p>The margin is the output of those settings working together. A good margin leaves a clear gap between the classes on both sides of the boundary. A bad one is too narrow, close to one class, or has points inside it. Always judge it with a held out test set, not by how the training plot looks.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4807\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM10.png\" alt=\"S V M Tutorial for Beginners - margin\" width=\"850\" height=\"696\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM10.png 446w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM10-300x246.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4808\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM11.png\" alt=\"S V M Tutorial for Beginners - margin example\" width=\"850\" height=\"667\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM11.png 445w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM11-300x235.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h2><strong><b>SVM in Python With scikit learn<\/b><\/strong><\/h2>\n<p>Here is a full program using two datasets. The first part compares the three main kernels on the Iris flower dataset, which has 150 flowers in 3 species. The second part uses a curved, noisy two class dataset to show what changing gamma and C actually does. The last line counts the support vectors.<\/p>\n<p>Notice that the first part wraps the SVM in a pipeline with a scaler. This matters, and the reason is explained in the next section.<\/p>\n<p>from sklearn.datasets import load_iris, make_moons<\/p>\n<p>from sklearn.model_selection import train_test_split<\/p>\n<p>from sklearn.pipeline import make_pipeline<\/p>\n<p>from sklearn.preprocessing import StandardScaler<\/p>\n<p>from sklearn.svm import SVC<\/p>\n<p>&nbsp;<\/p>\n<p># Part 1: three kernels on the Iris dataset<\/p>\n<p>X, y = load_iris(return_X_y=True)<\/p>\n<p>X_train, X_test, y_train, y_test = train_test_split(<\/p>\n<p>X, y, test_size=0.3, random_state=0, stratify=y<\/p>\n<p>)<\/p>\n<p>for kernel in [&#8220;linear&#8221;, &#8220;poly&#8221;, &#8220;rbf&#8221;]:<\/p>\n<p>model = make_pipeline(StandardScaler(), SVC(kernel=kernel))<\/p>\n<p>model.fit(X_train, y_train)<\/p>\n<p>print(kernel, &#8220;kernel test accuracy:&#8221;, round(model.score(X_test, y_test), 3))<\/p>\n<p>&nbsp;<\/p>\n<p># Part 2: how gamma and C change the result on curved data<\/p>\n<p>Xm, ym = make_moons(n_samples=300, noise=0.3, random_state=0)<\/p>\n<p>Xm_train, Xm_test, ym_train, ym_test = train_test_split(<\/p>\n<p>Xm, ym, test_size=0.3, random_state=0, stratify=ym<\/p>\n<p>)<\/p>\n<p>print(&#8220;gamma \u00a0train \u00a0test&#8221;)<\/p>\n<p>for gamma in [0.01, 1, 100]:<\/p>\n<p>m = SVC(kernel=&#8221;rbf&#8221;, gamma=gamma, C=1).fit(Xm_train, ym_train)<\/p>\n<p>print(gamma, round(m.score(Xm_train, ym_train), 3), round(m.score(Xm_test, ym_test), 3))<\/p>\n<p>print(&#8220;C \u00a0\u00a0\u00a0\u00a0\u00a0train \u00a0test&#8221;)<\/p>\n<p>for C in [0.01, 1, 1000]:<\/p>\n<p>m = SVC(kernel=&#8221;rbf&#8221;, gamma=1, C=C).fit(Xm_train, ym_train)<\/p>\n<p>print(C, round(m.score(Xm_train, ym_train), 3), round(m.score(Xm_test, ym_test), 3))<\/p>\n<p>&nbsp;<\/p>\n<p># Part 3: support vectors<\/p>\n<p>final = SVC(kernel=&#8221;rbf&#8221;, gamma=1, C=1).fit(Xm_train, ym_train)<\/p>\n<p>print(&#8220;Support vectors per class:&#8221;, final.n_support_, &#8220;of&#8221;, len(Xm_train), &#8220;training points&#8221;)<\/p>\n<h3><strong><b>Part 1: Three Kernels on Iris<\/b><\/strong><\/h3>\n<p>When I ran it, the first part printed:<\/p>\n<p>linear kernel test accuracy: 1.0<\/p>\n<p>poly kernel test accuracy: 0.867<\/p>\n<p>rbf kernel test accuracy: 0.978<\/p>\n<p>The test set has 45 flowers. The linear kernel classified all of them correctly. The rbf kernel missed one flower. The polynomial kernel missed six, because a curved boundary of this type is more than the Iris data needs. The simple kernel won, which is common on data that is already almost separable.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4809\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM12.png\" alt=\"S V M Tutorial for Beginners - linear kernel\" width=\"850\" height=\"581\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM12.png 645w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM12-300x205.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4810\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM13.png\" alt=\"S V M Tutorial for Beginners - poly kernel\" width=\"850\" height=\"601\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM13.png 628w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM13-300x212.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>Let\u2019s apply rbf kernel:<\/h3>\n<p>svc = svm.SVC(kernel=&#8217;rbf&#8217;, C=1,gamma=&#8217;auto&#8217;).fit(X, y)<\/p>\n<h3><strong>Output:<\/strong><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4811\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM14.png\" alt=\"S V M Tutorial for Beginners - rbf kernel\" width=\"850\" height=\"549\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM14.png 683w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM14-300x194.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3><strong><b>Part 2: The Effect of Gamma and C<\/b><\/strong><\/h3>\n<p>The second part printed:<\/p>\n<p>gamma \u00a0train \u00a0test<\/p>\n<p>0.01 0.843 0.756<\/p>\n<p>1 0.933 0.922<\/p>\n<p>100 0.986 0.922<\/p>\n<p>C \u00a0\u00a0\u00a0\u00a0\u00a0train \u00a0test<\/p>\n<p>0.01 0.857 0.767<\/p>\n<p>1 0.933 0.922<\/p>\n<p>1000 0.948 0.933<\/p>\n<div style=\"border: 1px solid #d9e0ea; border-radius: 8px; overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch;\">\n<table style=\"width: 100%; min-width: 700px; border-collapse: collapse; font-family: Arial,Helvetica,sans-serif; font-size: 16px; line-height: 1.6; color: #1f2937;\">\n<caption style=\"caption-side: top; text-align: left; padding: 14px 16px; font-weight: bold; font-size: 17px; color: #0f2a4a;\">SVM results for different gamma and C settings<\/caption>\n<thead>\n<tr>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 160px;\" scope=\"col\">Setting<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 160px;\" scope=\"col\">Train accuracy<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 160px;\" scope=\"col\">Test accuracy<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">What it shows<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">gamma 0.01<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">0.843<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">0.756<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Too smooth, underfits<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">gamma 1<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">0.933<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">0.922<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">A good balance<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">gamma 100<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">0.986<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">0.922<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Train rises, test does not<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">C 0.01<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">0.857<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">0.767<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Too forgiving, underfits<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">C 1<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">0.933<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">0.922<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">A good balance<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">C 1000<\/th>\n<td style=\"padding: 12px 16px;\">0.948<\/td>\n<td style=\"padding: 12px 16px;\">0.933<\/td>\n<td style=\"padding: 12px 16px;\">A small gain on test<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<ul>\n<li><b><\/b><strong><b>Both extremes at the low end underfit. <\/b><\/strong>Test accuracy drops to about 0.76.<\/li>\n<li><b><\/b><strong><b>Gamma 100 shows the start of overfitting. <\/b><\/strong>Training accuracy climbs to 0.986, but test accuracy stays at 0.922, so the extra fit bought nothing.<\/li>\n<li><b><\/b><strong><b>Be careful with small gaps. <\/b><\/strong>The test set has only 90 points, and one point is worth about 1.1 points of accuracy. The C 1000 result of 0.933 is one point better than C 1, which is within the noise, not proof that a high C is better.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4812\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM15.png\" alt=\"S V M Tutorial for Beginners - gamma\" width=\"850\" height=\"263\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM15.png 747w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM15-300x93.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4813\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM16.png\" alt=\"S V M Tutorial for Beginners - S V M example\" width=\"850\" height=\"258\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM16.png 777w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM16-300x91.png 300w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/SVM16-768x233.png 768w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3><strong><b>Part 3: Support Vectors<\/b><\/strong><\/h3>\n<p>The last line printed:<\/p>\n<p>Support vectors per class: [32 35] of 210 training points<\/p>\n<p>Only 67 of the 210 training points define the boundary. You can read them from the model with the support_vectors_ attribute, and the count per class with n_support_.<\/p>\n<h2><strong><b>Practical Advice Before You Use SVM<\/b><\/strong><\/h2>\n<h3><strong><b>Always Scale Your Data<\/b><\/strong><\/h3>\n<p>SVM measures distances, so a feature with large numbers, such as salary, will swamp one with small numbers, such as age. SVMs are not scale invariant. Use StandardScaler inside a pipeline, as the program does, so the scaler is fitted only on training data.<\/p>\n<h3><strong><b>Tune C and Gamma Together<\/b><\/strong><\/h3>\n<p>Use GridSearchCV and try values spaced by powers of ten, such as 0.01, 0.1, 1, 10 and 100. The best C and gamma depend on each other, so search them together, not one at a time.<\/p>\n<h3><strong><b>Be Careful With Probabilities<\/b><\/strong><\/h3>\n<p>SVC does not give probabilities by default. Setting probability=True adds an extra cross validation step, which makes training much slower. If you only need a ranking or a confidence score, use decision_function instead.<\/p>\n<h3><strong><b>Watch the Size of Your Data<\/b><\/strong><\/h3>\n<p>Training time grows quickly with the number of rows, somewhere between the square and the cube. It is comfortable up to tens of thousands of rows. For much larger data, use LinearSVC, which scales almost in a straight line.<\/p>\n<h3><strong><b>Handle Imbalanced Classes<\/b><\/strong><\/h3>\n<p>If one class is rare, set class_weight to balanced, so mistakes on the rare class cost more.<\/p>\n<h2><strong><b>Strengths and Limitations of SVM<\/b><\/strong><\/h2>\n<h3><strong><b>Strengths<\/b><\/strong><\/h3>\n<ul>\n<li>Works well when there are many features, even more than rows.<\/li>\n<li>Effective on small and medium datasets.<\/li>\n<li>Memory efficient, because only support vectors are stored.<\/li>\n<li>Flexible, because different kernels fit different shapes of data.<\/li>\n<\/ul>\n<h3><strong><b>Limitations<\/b><\/strong><\/h3>\n<ul>\n<li>Slow to train on very large datasets.<\/li>\n<li>Sensitive to feature scaling and needs tuning of C and gamma.<\/li>\n<li>Does not give probabilities directly.<\/li>\n<li>Hard to interpret with non linear kernels.<\/li>\n<li>Can struggle when classes overlap heavily and the data is noisy.<\/li>\n<\/ul>\n<h2><strong><b>Where SVM is Used?<\/b><\/strong><\/h2>\n<ul>\n<li><b><\/b><strong><b>Text classification. <\/b><\/strong>Spam filtering and topic labelling, where each word is a feature.<\/li>\n<li><b><\/b><strong><b>Image classification. <\/b><\/strong>Handwritten digit and face recognition on smaller datasets.<\/li>\n<li><b><\/b><b><\/b>Classifying genes and proteins, where features are many and samples are few.<\/li>\n<li><b><\/b><strong><b>Fault detection. <\/b><\/strong>Spotting abnormal readings in industrial sensor data.<\/li>\n<\/ul>\n<h2><strong><b>Common Mistakes to Avoid<\/b><\/strong><\/h2>\n<ul>\n<li><b><\/b><strong><b>Not scaling the data. <\/b><\/strong>This is the number one cause of poor SVM results.<\/li>\n<li><b><\/b><strong><b>Judging by training accuracy. <\/b><\/strong>A high C or gamma can score near perfect on training and still fail on new data.<\/li>\n<li><b><\/b><strong><b>Jumping straight to a complex kernel. <\/b><\/strong>Try linear first, as it is faster and often enough.<\/li>\n<li><b><\/b><strong><b>Tuning C and gamma separately. <\/b><\/strong>They interact, so search them together.<\/li>\n<li><b><\/b><strong><b>Switching on probability without need. <\/b><\/strong>It slows training by a large margin.<\/li>\n<li><b><\/b><strong><b>Using SVC on huge data. <\/b><\/strong>Use LinearSVC or another model instead.<\/li>\n<\/ul>\n<p>A support vector machine draws the widest possible fence between classes, and the kernel trick lets that fence bend when it needs to. Run the program above, then try it on your own data. Scale first, start with a linear kernel, move to rbf if you need to, and tune C and gamma together with cross validation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Support Vector Machine Tutorial for Beginners Imagine two groups of houses on opposite sides of a river, and you need to draw a fence that separates them. You could draw it anywhere in the gap, but some fences are better than others. A fence that hugs one group is risky, because a new house built [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,1696],"tags":[422],"class_list":["post-4797","post","type-post","status-publish","format-standard","hentry","category-machine-learning","category-machine-learning-modules","tag-support-vector-machine-tutorial-for-beginners"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Support Vector Machine Tutorial for Beginners With Python<\/title>\n<meta name=\"description\" content=\"Learn how SVM finds the best hyperplane, what support vectors and margins are, how kernels, C and gamma work, with Python code that was tested.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Support Vector Machine Tutorial for Beginners With Python\" \/>\n<meta property=\"og:description\" content=\"Learn how SVM finds the best hyperplane, what support vectors and margins are, how kernels, C and gamma work, with Python code that was tested.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/\" \/>\n<meta property=\"og:site_name\" content=\"Prwatech\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prwatech.in\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-15T11:30:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-15T16:05:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"589\" \/>\n\t<meta property=\"og:image:height\" content=\"428\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Prwatech\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:site\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prwatech\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/\",\"url\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/\",\"name\":\"Support Vector Machine Tutorial for Beginners With Python\",\"isPartOf\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm1.png\",\"datePublished\":\"2020-02-15T11:30:32+00:00\",\"dateModified\":\"2026-10-15T16:05:21+00:00\",\"author\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\"},\"description\":\"Learn how SVM finds the best hyperplane, what support vectors and margins are, how kernels, C and gamma work, with Python code that was tested.\",\"breadcrumb\":{\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/#primaryimage\",\"url\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm1.png\",\"contentUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm1.png\",\"width\":589,\"height\":428},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/prwatech.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Support Vector Machine Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/prwatech.in\/blog\/#website\",\"url\":\"https:\/\/prwatech.in\/blog\/\",\"name\":\"Prwatech\",\"description\":\"Share Ideas, Start Something Good.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/prwatech.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\",\"name\":\"Prwatech\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"caption\":\"Prwatech\"},\"url\":\"https:\/\/prwatech.in\/blog\/author\/prwatech123\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Support Vector Machine Tutorial for Beginners With Python","description":"Learn how SVM finds the best hyperplane, what support vectors and margins are, how kernels, C and gamma work, with Python code that was tested.","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:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/","og_locale":"en_US","og_type":"article","og_title":"Support Vector Machine Tutorial for Beginners With Python","og_description":"Learn how SVM finds the best hyperplane, what support vectors and margins are, how kernels, C and gamma work, with Python code that was tested.","og_url":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/","og_site_name":"Prwatech","article_publisher":"https:\/\/www.facebook.com\/prwatech.in\/","article_published_time":"2020-02-15T11:30:32+00:00","article_modified_time":"2026-10-15T16:05:21+00:00","og_image":[{"width":589,"height":428,"url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm1.png","type":"image\/png"}],"author":"Prwatech","twitter_card":"summary_large_image","twitter_creator":"@Eduprwatech","twitter_site":"@Eduprwatech","twitter_misc":{"Written by":"Prwatech","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/","url":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/","name":"Support Vector Machine Tutorial for Beginners With Python","isPartOf":{"@id":"https:\/\/prwatech.in\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/#primaryimage"},"image":{"@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/#primaryimage"},"thumbnailUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm1.png","datePublished":"2020-02-15T11:30:32+00:00","dateModified":"2026-10-15T16:05:21+00:00","author":{"@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3"},"description":"Learn how SVM finds the best hyperplane, what support vectors and margins are, how kernels, C and gamma work, with Python code that was tested.","breadcrumb":{"@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/#primaryimage","url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm1.png","contentUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2020\/02\/svm1.png","width":589,"height":428},{"@type":"BreadcrumbList","@id":"https:\/\/prwatech.in\/blog\/machine-learning\/machine-learning-modules\/support-vector-machine-tutorial-for-beginners\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/prwatech.in\/blog\/"},{"@type":"ListItem","position":2,"name":"Support Vector Machine Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/prwatech.in\/blog\/#website","url":"https:\/\/prwatech.in\/blog\/","name":"Prwatech","description":"Share Ideas, Start Something Good.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/prwatech.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3","name":"Prwatech","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","caption":"Prwatech"},"url":"https:\/\/prwatech.in\/blog\/author\/prwatech123\/"}]}},"_links":{"self":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/4797","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/comments?post=4797"}],"version-history":[{"count":21,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/4797\/revisions"}],"predecessor-version":[{"id":12010,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/4797\/revisions\/12010"}],"wp:attachment":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/media?parent=4797"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/categories?post=4797"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/tags?post=4797"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}