{"id":10717,"date":"2018-04-28T14:00:19","date_gmt":"2018-04-28T08:30:19","guid":{"rendered":"http:\/\/ucanalytics.com\/blogs\/?p=10717"},"modified":"2018-08-21T11:11:12","modified_gmt":"2018-08-21T05:41:12","slug":"machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2","status":"publish","type":"post","link":"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/","title":{"rendered":"Machine Learning : Regularization &#8211; Ridge, Lasso, &#038; Elastic Net Simplified (Part 2)"},"content":{"rendered":"<hr \/>\n<div id=\"attachment_10718\" style=\"width: 679px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Regularization-Lasso-and-Ridge.jpg\"><img aria-describedby=\"caption-attachment-10718\" data-attachment-id=\"10718\" data-permalink=\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/regularization-lasso-and-ridge\/\" data-orig-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Regularization-Lasso-and-Ridge.jpg?fit=736%2C531&amp;ssl=1\" data-orig-size=\"736,531\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Regularization Lasso and Ridge\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Regularization-Lasso-and-Ridge.jpg?fit=300%2C216&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Regularization-Lasso-and-Ridge.jpg?fit=640%2C462&amp;ssl=1\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-10718\" src=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Regularization-Lasso-and-Ridge.jpg?resize=640%2C462\" alt=\"\" width=\"640\" height=\"462\" srcset=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Regularization-Lasso-and-Ridge.jpg?w=736&amp;ssl=1 736w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Regularization-Lasso-and-Ridge.jpg?resize=250%2C180&amp;ssl=1 250w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Regularization-Lasso-and-Ridge.jpg?resize=300%2C216&amp;ssl=1 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/a><p id=\"caption-attachment-10718\" class=\"wp-caption-text\">Machine Learning: Regularization (Ridge, Lasso, and Elastic Nets) &#8211; by Roopam<\/p><\/div>\n<p>In the previous article, we started with the theme that\u00a0<strong><a href=\"http:\/\/ucanalytics.com\/blogs\/machine-learning-non-linear-regression-regularization-cross-validation-simplified-part-1\/\" target=\"_blank\" rel=\"noopener\">overfitting is an inherent problem in machine learning associated with big data<\/a><\/strong>. Essentially, if you have many variables and their\u00a0polynomial\u00a0terms (X-variables) in a model you could fit any response data (y-variable) to perfection. This perfect fit for the observed data is overfitting since this model will generalize\u00a0poorly to the unobserved data.\u00a0 In this post, you will learn the ways of overcoming this problem with regularization techniques. But before that let&#8217;s visit a funfair!<\/p>\n<h2><span style=\"color: #3366ff;\">Regularization and Funfair<\/span><\/h2>\n<p><a href=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Regularization-in-Machine-Learning-Funfair.jpg\"><img data-attachment-id=\"10936\" data-permalink=\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/regularization-in-machine-learning-funfair\/\" data-orig-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Regularization-in-Machine-Learning-Funfair.jpg?fit=707%2C924&amp;ssl=1\" data-orig-size=\"707,924\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Regularization in Machine Learning &#8211; Funfair\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Regularization-in-Machine-Learning-Funfair.jpg?fit=230%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Regularization-in-Machine-Learning-Funfair.jpg?fit=640%2C836&amp;ssl=1\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-10936 alignright\" src=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Regularization-in-Machine-Learning-Funfair.jpg?resize=293%2C382\" alt=\"\" width=\"293\" height=\"382\" srcset=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Regularization-in-Machine-Learning-Funfair.jpg?w=707&amp;ssl=1 707w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Regularization-in-Machine-Learning-Funfair.jpg?resize=191%2C250&amp;ssl=1 191w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Regularization-in-Machine-Learning-Funfair.jpg?resize=230%2C300&amp;ssl=1 230w\" sizes=\"(max-width: 293px) 100vw, 293px\" data-recalc-dims=\"1\" \/><\/a>I was 6 or 7 when one evening my grandmother took all her grandchildren to the local funfair. At the entry,\u00a0she announced that we could take as many rides as we liked and as many times as we wanted. Yay! shouted all us kids with joy. She continued &#8211; as long as the expense was kept under 2 rupees, and we would get back home by 7 PM. This second instruction could have been a big dampener. However, I remember having a great time at the fair managing grandma&#8217;s instructions.<\/p>\n<p>Many years later, when I was in Orlando, I visited Disney Land (or was it Universal Studios?) with my friends. This was a much grander funfair than the one my grandma took me to. I managed to get a 3-day pass at a discounted price.\u00a0 This time I could actually take as many rides and as many times I wanted. I was finally liberated from my grandma&#8217;s instructions. After I took a few head-spinning rides, I was so rattled that by evening I opted to rest\u00a0under a tree while my friends were finishing up. I didn&#8217;t go to the amusement park for the remaining two days. I guess constraints imposed by my grandma were not all that bad.<\/p>\n<p>You will soon realize that my grandma&#8217;s instructions and regularization in machine learning are quite similar.<\/p>\n<h2><span style=\"color: #3366ff;\">Regularization &#8211; Intuition (Grandma to the Rescue)<\/span><\/h2>\n<p>In the subsequent segments, you will notice a few intimidating equations. However,\u00a0 you must not get intimidated\u00a0by them since they are very similar to my grandma&#8217;s instructions. The first instruction was to try as many rides as you wish. This instruction had no constraints. In terms of the objective for machine learning it can be represented as:<\/p>\n<pre><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=Loss%5C+Function%5C+%28LF%29%3A+MSE%3D%5Cfrac%7B1%7D%7BN%7D+%5Csum_%7Bi%3D1%7D%5E%7BN%7D+%28y_%7Bi%7D-%5Chat%7By%7D_%7Bi%7D%29%5E%7B2%7D+&#038;bg=ffffff&#038;fg=000&#038;s=2&#038;c=20201002\" alt=\"Loss&#92; Function&#92; (LF): MSE=&#92;frac{1}{N} &#92;sum_{i=1}^{N} (y_{i}-&#92;hat{y}_{i})^{2} \" class=\"latex\" \/><\/pre>\n<p>Now, you must have seen this equation for the loss function in one of my earlier posts on<strong><a href=\"http:\/\/ucanalytics.com\/blogs\/intuitive-machine-learning-gradient-descent-simplified\/\" target=\"_blank\" rel=\"noopener\"> gradient descent optimization for linear regression<\/a><\/strong>. This loss function\u00a0is essentially the mean square error (MSE) in the estimation of the y variable using the x variables. The objective is to minimize the MSE or the loss function. The\u00a0y-variable\u00a0is estimated by the linear combination of the X variables.<\/p>\n<pre><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=%5Chat%7By%7D_%7Bi%7D%3D%5Ctheta_%7B0%7D%2B%5Ctheta_%7B1%7Dx_%7B1%7D%5E%7B%28i%29%7D%2B%5Ctheta_%7B2%7Dx_%7B2%7D%5E%7B%28i%29%7D%2B%5Cdots%2B%5Ctheta_%7BM%7Dx_%7BM%7D%5E%7B%28i%29%7D+&#038;bg=ffffff&#038;fg=000&#038;s=2&#038;c=20201002\" alt=\"&#92;hat{y}_{i}=&#92;theta_{0}+&#92;theta_{1}x_{1}^{(i)}+&#92;theta_{2}x_{2}^{(i)}+&#92;dots+&#92;theta_{M}x_{M}^{(i)} \" class=\"latex\" \/><\/pre>\n<p>Here, the equation can take any value for the \u03b8 parameters between -\u221e to \u221e. This complete freedom also leads to overfitting since there are no constraints on the \u03b8s. Now, similar to grandma&#8217;s second instruction, let&#8217;s add a few regulations on this complete freedom. The most commonly used regularizations are L1 and L2. Let&#8217;s start with L2 first.<\/p>\n<h2><span style=\"color: #3366ff;\">L2 Regularization: Ridge Regression<\/span><\/h2>\n<p>Here, I will take a few liberties to create linkages between my grandma&#8217;s second instruction and regularization. Let me relive her instructions one more time. First, let&#8217;s just consider the time constraint imposed by her i.e. to get back home by 7 PM (spend an hour at the fair). Let&#8217;s assume there were 10 rides and each ride takes 3 minutes. Then I could have taken all the 10 rides in the first 30 minutes. The remaining 30 minutes could then be spent on rides on which I had the most fun.<\/p>\n<p>This is similar to L2 regularization which is ridge regression in this case.\u00a0 This regularization term is added after MSE in the loss function i.e. \u03bb\u2211\u03b8<sup>2<\/sup>. This is similar to saying spend 1 hour in the fair not infinite. Here \u03bb is a constant which is also caller hyper-parameter.<\/p>\n<pre><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=LF%3A+%5Cfrac%7B1%7D%7BN%7D+%5Csum_%7Bi%3D1%7D%5E%7BN%7D+%28y_%7Bi%7D-%5Chat%7By%7D_%7Bi%7D%29%5E%7B2%7D%2B+%5Clambda%5Csum_%7Bj%3D1%7D%5E%7BM%7D%5Ctheta_%7Bj%7D%5E%7B2%7D&#038;bg=ffffff&#038;fg=000&#038;s=2&#038;c=20201002\" alt=\"LF: &#92;frac{1}{N} &#92;sum_{i=1}^{N} (y_{i}-&#92;hat{y}_{i})^{2}+ &#92;lambda&#92;sum_{j=1}^{M}&#92;theta_{j}^{2}\" class=\"latex\" \/><\/pre>\n<p>This constraint is imposed on the \u03b8 parameters. Essentially, all the \u03b8s will have some small value similar to how I spent the first 30 minutes exploring all the rides. Then the \u03b8 parameters with the highest contribution to minimizing MSE will get higher values. Hence, L2 regularization assigns values to all the \u03b8 parameters or all the X variables feature in the final equation.<\/p>\n<h2><span style=\"color: #3366ff;\">L1 Regularization: Lasso\u00a0<\/span><\/h2>\n<p>The other constraint by my grandma was on the total expenditure. As a kid, growing by in India 35 years ago, time was always more available than money. Hence, I could not have taken all the rides. Here, I would observe and\u00a0evaluate the rides from a distance first. Then I would take the rides I believed I would enjoy. This is L1 regularization or Lasso. The additional term for this is again at the end.i.e. \u03bb\u2211|\u03b8<span style=\"font-size: 13.3333px;\">|\u00a0<\/span><\/p>\n<pre><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=LF%3A+%5Cfrac%7B1%7D%7BN%7D+%5Csum_%7Bi%3D1%7D%5E%7BN%7D+%28y_%7Bi%7D-%5Chat%7By%7D_%7Bi%7D%29%5E%7B2%7D%2B+%5Clambda%5Csum_%7Bj%3D1%7D%5E%7BM%7D%5Cleft+%7C+%5Ctheta_%7Bj%7D+%5Cright+%7C&#038;bg=ffffff&#038;fg=000&#038;s=2&#038;c=20201002\" alt=\"LF: &#92;frac{1}{N} &#92;sum_{i=1}^{N} (y_{i}-&#92;hat{y}_{i})^{2}+ &#92;lambda&#92;sum_{j=1}^{M}&#92;left | &#92;theta_{j} &#92;right |\" class=\"latex\" \/><\/pre>\n<p>Lasso or L1 regularization will ensure that only useful predictor variables or Xs get a weight or non-zero\u00a0\u03b8 parameters. Lasso essentially sets \u03b8s to zero for less useful x variables.<\/p>\n<h2><span style=\"color: #3366ff;\">Elastic Net Regularization: Ridge + Lasso<\/span><\/h2>\n<p>Elastic net is essentially imposing both L1 and L2 at the same time. This is similar to my grandmother&#8217;s instruction about managing both time and expense at the same time. Notice, both these terms are at the end of the loss function.<\/p>\n<pre><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=LF%3A+%5Cfrac%7B1%7D%7BN%7D+%5Csum_%7Bi%3D1%7D%5E%7BN%7D+%28y_%7Bi%7D-%5Chat%7By%7D_%7Bi%7D%29%5E%7B2%7D%2B+%5Clambda%5Cleft+%5B+%281-%5Calpha%29%5Csum_%7Bj%3D1%7D%5E%7BM%7D%5Ctheta_%7Bj%7D%5E%7B2%7D%2B+%5Calpha%5Csum_%7Bj%3D1%7D%5E%7BM%7D%5Cleft+%7C+%5Ctheta_%7Bj%7D+%5Cright+%7C%5Cright+%5D&#038;bg=ffffff&#038;fg=000&#038;s=2&#038;c=20201002\" alt=\"LF: &#92;frac{1}{N} &#92;sum_{i=1}^{N} (y_{i}-&#92;hat{y}_{i})^{2}+ &#92;lambda&#92;left [ (1-&#92;alpha)&#92;sum_{j=1}^{M}&#92;theta_{j}^{2}+ &#92;alpha&#92;sum_{j=1}^{M}&#92;left | &#92;theta_{j} &#92;right |&#92;right ]\" class=\"latex\" \/><\/pre>\n<p>This time we have two hyperparameters. The first hyperparameter is lambda (\u03bb) similar to the previous equations. The second hyperparameter is alpha (\u03b1) which takes the value between 0 and 1. When \u03b1 is 1, then the regularization term is purely lasso. For\u00a0\u03b1=0.5, the regularization has 50% regularization from lasso and 50% form Ridge. Now, let&#8217;s solve the problem of the\u00a0sine function we started in the previous part.<\/p>\n<h2><span style=\"color: #3366ff;\">Sine Curve &#8211; Regularization to Reduce Overfitting<\/span><\/h2>\n<p>We had the population for the sine curve displayed with the gray line in the plot between -3\u03c0 to 3\u03c0. This is an unusual situation where we know the population distribution with complete certainty\u00a0&#8211; unlike any other analysis in real life. The R-code to replicate the analysis is\u00a0<strong><a href=\"http:\/\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Part-1-Regularization-Lasso-Ridge-Elastic-Net-and-Cross-Validation.txt\">Regularization &#8211; Lasso &amp; Ridge (Elastic Net) and Cross-Validation<\/a><\/strong><\/p>\n<p><a href=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-0-Data-for-Regression-with-Regularization.jpg\"><img data-attachment-id=\"10970\" data-permalink=\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/graph-0-data-for-regression-with-regularization\/\" data-orig-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-0-Data-for-Regression-with-Regularization.jpg?fit=1310%2C742&amp;ssl=1\" data-orig-size=\"1310,742\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Graph 0 &#8211; Data for Regression with Regularization\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-0-Data-for-Regression-with-Regularization.jpg?fit=300%2C170&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-0-Data-for-Regression-with-Regularization.jpg?fit=640%2C363&amp;ssl=1\" decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-10970\" src=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-0-Data-for-Regression-with-Regularization.jpg?resize=640%2C363\" alt=\"\" width=\"640\" height=\"363\" srcset=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-0-Data-for-Regression-with-Regularization.jpg?w=1310&amp;ssl=1 1310w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-0-Data-for-Regression-with-Regularization.jpg?resize=250%2C142&amp;ssl=1 250w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-0-Data-for-Regression-with-Regularization.jpg?resize=300%2C170&amp;ssl=1 300w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-0-Data-for-Regression-with-Regularization.jpg?resize=768%2C435&amp;ssl=1 768w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-0-Data-for-Regression-with-Regularization.jpg?resize=1024%2C580&amp;ssl=1 1024w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>Now, we will draw the training and testing sample from the population. Notice, the sample data (dots) are not exactly on the population line. Since the act of measurement is not perfect and adds some random noise to the data. The training sample (blue dots) will be used to build the model. The trained models will be validated on the testing sample (red dots). The testing sample is the unobserved data for the model. Hence, the accuracy on the testing sample is a good proof that the model is generalizable.<\/p>\n<h2><span style=\"color: #3366ff;\">The First Model &#8211; Complete Freedom or No Regularization<\/span><\/h2>\n<p>Here, response variable, y, is the sine function i.e. sin(x). The X-variables, predictors, are the 15 polynomial terms of x.<\/p>\n<pre><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=sin%28x%29%3D%5Ctheta+_%7B0%7D%2B%5Ctheta+_%7B1%7Dx%2B%5Ctheta+_%7B2%7Dx%5E2%2B%5Ccdots+%2B%5Ctheta+_%7B15%7Dx%5E%7B15%7D&#038;bg=ffffff&#038;fg=000&#038;s=2&#038;c=20201002\" alt=\"sin(x)=&#92;theta _{0}+&#92;theta _{1}x+&#92;theta _{2}x^2+&#92;cdots +&#92;theta _{15}x^{15}\" class=\"latex\" \/><\/pre>\n<p>The first model is built without any regularization terms &#8211; grandma&#8217;s first instruction! This means the model has a complete freedom to choose the \u03b8-parameters without any constraints. This model&#8217;s estimated curve is shown with the orange line in this plot.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-1-Regression-with-No-Regularization.jpeg\"><img data-attachment-id=\"10991\" data-permalink=\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/graph-1-regression-with-no-regularization\/\" data-orig-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-1-Regression-with-No-Regularization.jpeg?fit=578%2C353&amp;ssl=1\" data-orig-size=\"578,353\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1524908824&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}\" data-image-title=\"Graph 1 &#8211; Regression with No Regularization\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-1-Regression-with-No-Regularization.jpeg?fit=300%2C183&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-1-Regression-with-No-Regularization.jpeg?fit=578%2C353&amp;ssl=1\" decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-10991\" src=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-1-Regression-with-No-Regularization.jpeg?resize=578%2C353\" alt=\"\" width=\"578\" height=\"353\" srcset=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-1-Regression-with-No-Regularization.jpeg?w=578&amp;ssl=1 578w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-1-Regression-with-No-Regularization.jpeg?resize=250%2C153&amp;ssl=1 250w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-1-Regression-with-No-Regularization.jpeg?resize=300%2C183&amp;ssl=1 300w\" sizes=\"(max-width: 578px) 100vw, 578px\" data-recalc-dims=\"1\" \/><\/a>The model-fit looks quite good for both train and test data between -4 to +4 range. The model, however, goes nuts on either corner. This erratic behavior could be attributed to fewer blue dots (training data) in these positions. The model has, essentially, tried to perfectly fit every blue dot. This is the reason the MSE for the training sample is very low at 0.02. This perfect fit, however, is not generalizable. Hence, the MSE for the testing sample is close to 2 million (whoops). We need to make the model more generalizable by adding regularization terms.<\/p>\n<h2><span style=\"color: #3366ff;\">Second Model &#8211; Intuitive Regularization Term<\/span><\/h2>\n<p>Now, let&#8217;s add an intuitive regularization term to this model. We know, from the previous article, that for the sine curve the even powers of x (i.e. x<sup>2<\/sup>, x<sup>4<\/sup>, x<sup>6<\/sup>&#8230;) have no contribution. In other words,\u00a0\u03b8<sub>2\u00a0<\/sub>=0, \u03b8<sub>4<\/sub>=0, \u03b8<sub>6 <\/sub>=0 and so on. This is a good case for L1 regularization. Remember, Lasso or L1 regularization reduces the \u03b8 parameters for useless terms to zero &#8211; unlike Ridge regression. This means we will set hyper-parameter alpha to one for this model (\u03b1=1).<\/p>\n<p>Moreover, the non-regularized model was performing quite OK for the x range of -4 to 4. Hence, we don&#8217;t want to add a very strong regularization term to our model. This means we will keep the value of the second hyper-parameter, lambda, small i.e. \u03bb = 0.0001<span style=\"font-size: 13.3333px;\">.<\/span><\/p>\n<p><a href=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-2-Regression-with-Regularization-Lasso-and-Guessed-Lambda.jpg\"><img data-attachment-id=\"10924\" data-permalink=\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/graph-2-regression-with-regularization-lasso-and-guessed-lambda\/\" data-orig-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-2-Regression-with-Regularization-Lasso-and-Guessed-Lambda.jpg?fit=1289%2C742&amp;ssl=1\" data-orig-size=\"1289,742\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Graph 2 &#8211; Regression with Regularization (Lasso and Guessed Lambda)\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-2-Regression-with-Regularization-Lasso-and-Guessed-Lambda.jpg?fit=300%2C173&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-2-Regression-with-Regularization-Lasso-and-Guessed-Lambda.jpg?fit=640%2C368&amp;ssl=1\" decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-10924\" src=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-2-Regression-with-Regularization-Lasso-and-Guessed-Lambda.jpg?resize=640%2C368\" alt=\"\" width=\"640\" height=\"368\" srcset=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-2-Regression-with-Regularization-Lasso-and-Guessed-Lambda.jpg?w=1289&amp;ssl=1 1289w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-2-Regression-with-Regularization-Lasso-and-Guessed-Lambda.jpg?resize=250%2C144&amp;ssl=1 250w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-2-Regression-with-Regularization-Lasso-and-Guessed-Lambda.jpg?resize=300%2C173&amp;ssl=1 300w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-2-Regression-with-Regularization-Lasso-and-Guessed-Lambda.jpg?resize=768%2C442&amp;ssl=1 768w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-2-Regression-with-Regularization-Lasso-and-Guessed-Lambda.jpg?resize=1024%2C589&amp;ssl=1 1024w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>For this regularized model, the MSE for the training data has significantly gone up from 0.02 to 1377. However, the MSE of test data is down by a factor of 100. This model is doing much better on the unobserved test data.<\/p>\n<p>So the model&#8217;s accuracy depends on the hyper-parameters: alpha and lambda. But how do we know that we have used the best possible value for lambda and alpha in the loss function? A solution to the problem of identification of optimal values for the hyper-parameters is&#8230;<\/p>\n<h2><span style=\"color: #3366ff;\">Cross-Validation<\/span><\/h2>\n<p>Cross-validation is a way to test several combinations of hyper-parameters to identify their optimal values. This method works on the training sample. But wait a minute, we know if we train the model on the entire training data then overfitting is inevitable. There is a clever trick to guard against overfitting i.e. extract a validation sample from the training data. Let&#8217;s see how a 5-fold cross validation works.<\/p>\n<p><img data-attachment-id=\"11004\" data-permalink=\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/cross-validation-5-fold-you-canalytics\/\" data-orig-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Cross-Validation-5-Fold-YOU-CANalytics.png?fit=1422%2C649&amp;ssl=1\" data-orig-size=\"1422,649\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Cross Validation &#8211; 5 Fold (YOU CANalytics)\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Cross-Validation-5-Fold-YOU-CANalytics.png?fit=300%2C137&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Cross-Validation-5-Fold-YOU-CANalytics.png?fit=640%2C292&amp;ssl=1\" decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-11004\" src=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Cross-Validation-5-Fold-YOU-CANalytics.png?resize=640%2C292\" alt=\"\" width=\"640\" height=\"292\" srcset=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Cross-Validation-5-Fold-YOU-CANalytics.png?w=1422&amp;ssl=1 1422w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Cross-Validation-5-Fold-YOU-CANalytics.png?resize=250%2C114&amp;ssl=1 250w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Cross-Validation-5-Fold-YOU-CANalytics.png?resize=300%2C137&amp;ssl=1 300w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Cross-Validation-5-Fold-YOU-CANalytics.png?resize=768%2C351&amp;ssl=1 768w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Cross-Validation-5-Fold-YOU-CANalytics.png?resize=1024%2C467&amp;ssl=1 1024w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Cross-Validation-5-Fold-YOU-CANalytics.png?w=1280 1280w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>We have 30 data points in our training data. We will randomly divide these data into 5 groups (5-fold). Each group will have the same size i.e. 6 observations per fold. The models are then trained on 4 folds of data, and the remaining fold is used to test the model. This way you will have 5 models per combination of hyperparameters. The hyper-parameter combination that gives the best model statistics for the testing folds is considered as the optimal. The best model statistics is the lowest value of both mean and standard deviation for MSE (mean standard errors).<\/p>\n<h2><span style=\"color: #3366ff;\">Third Model &#8211; Explore\u00a0\u03bb Values with Cross-Validation<\/span><\/h2>\n<p>We will run a quick and dirty cross-validation model to conclude this article. In the last part of this series, we shall explore cross-validation and hyper-parameter tuning in greater details. In this model, we will keep the alpha fixed to keep things simple i.e.\u00a0\u03b1=1. We will try different values for lambda(\u03bb) to find the best value of\u00a0\u03bb. We will try one-thousand different values of\u00a0\u03bb between 10<sup>-6\u00a0<\/sup>to 1.\u00a0 It turned out that the MSE for\u00a0\u03bb=0.00448 is the lowest for all the 1000 tried values. The model for this value of lambda is:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-3-Regression-with-Regularization-Lasso-and-Cross-Validated-Lambda.jpg\"><img data-attachment-id=\"10925\" data-permalink=\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/graph-3-regression-with-regularization-lasso-and-cross-validated-lambda\/\" data-orig-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-3-Regression-with-Regularization-Lasso-and-Cross-Validated-Lambda.jpg?fit=1293%2C742&amp;ssl=1\" data-orig-size=\"1293,742\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Graph 3 &#8211; Regression with Regularization (Lasso and Cross Validated Lambda)\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-3-Regression-with-Regularization-Lasso-and-Cross-Validated-Lambda.jpg?fit=300%2C172&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-3-Regression-with-Regularization-Lasso-and-Cross-Validated-Lambda.jpg?fit=640%2C368&amp;ssl=1\" decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-10925\" src=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-3-Regression-with-Regularization-Lasso-and-Cross-Validated-Lambda.jpg?resize=640%2C367\" alt=\"\" width=\"640\" height=\"367\" srcset=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-3-Regression-with-Regularization-Lasso-and-Cross-Validated-Lambda.jpg?w=1293&amp;ssl=1 1293w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-3-Regression-with-Regularization-Lasso-and-Cross-Validated-Lambda.jpg?resize=250%2C143&amp;ssl=1 250w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-3-Regression-with-Regularization-Lasso-and-Cross-Validated-Lambda.jpg?resize=300%2C172&amp;ssl=1 300w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-3-Regression-with-Regularization-Lasso-and-Cross-Validated-Lambda.jpg?resize=768%2C441&amp;ssl=1 768w, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/04\/Graph-3-Regression-with-Regularization-Lasso-and-Cross-Validated-Lambda.jpg?resize=1024%2C588&amp;ssl=1 1024w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/a>For this third model, the MSE for both training and testing sample is significantly lower than the second model. Our guess for the value of \u03bb was not bad, but cross-validation has done a much better job of finding the best value. This model has essentially lost some level of predictive power in the middle of the plot to achieve a greater accuracy at the corners.<\/p>\n<h4><span style=\"color: #3366ff;\">Sign-off Note<\/span><\/h4>\n<p>As a kid I had no clue that at the fair I was optimizing while being regularized by my grandmother&#8217;s instructions. I guess we are training our machines the same way our previous generations trained us.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the previous article, we started with the theme that\u00a0overfitting is an inherent problem in machine learning associated with big data. Essentially, if you have many variables and their\u00a0polynomial\u00a0terms (X-variables) in a model you could fit any response data (y-variable) to perfection. This perfect fit for the observed data is overfitting since this model will<\/p>\n<p><a class=\"excerpt-more blog-excerpt\" href=\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":10718,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[84,85],"tags":[],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Machine Learning : Regularization - Ridge, Lasso, &amp; Elastic Net Simplified (Part 2) &ndash; YOU CANalytics |<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Machine Learning : Regularization - Ridge, Lasso, &amp; Elastic Net Simplified (Part 2) &ndash; YOU CANalytics |\" \/>\n<meta property=\"og:description\" content=\"In the previous article, we started with the theme that\u00a0overfitting is an inherent problem in machine learning associated with big data. Essentially, if you have many variables and their\u00a0polynomial\u00a0terms (X-variables) in a model you could fit any response data (y-variable) to perfection. This perfect fit for the observed data is overfitting since this model willRead More...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/\" \/>\n<meta property=\"og:site_name\" content=\"YOU CANalytics |\" \/>\n<meta property=\"article:author\" content=\"roopam\" \/>\n<meta property=\"article:published_time\" content=\"2018-04-28T08:30:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-08-21T05:41:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Regularization-Lasso-and-Ridge.jpg?fit=736%2C531&#038;ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"736\" \/>\n\t<meta property=\"og:image:height\" content=\"531\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Roopam Upadhyay\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#organization\",\"name\":\"YOU CANalytics\",\"url\":\"https:\/\/ucanalytics.com\/blogs\/\",\"sameAs\":[],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2015\/11\/YOU-CANalytics-Logo.jpg?fit=607%2C120\",\"contentUrl\":\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2015\/11\/YOU-CANalytics-Logo.jpg?fit=607%2C120\",\"width\":607,\"height\":120,\"caption\":\"YOU CANalytics\"},\"image\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#website\",\"url\":\"https:\/\/ucanalytics.com\/blogs\/\",\"name\":\"YOU CANalytics |\",\"description\":\"Explore the Power of Data Science\",\"publisher\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ucanalytics.com\/blogs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Regularization-Lasso-and-Ridge.jpg?fit=736%2C531&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Regularization-Lasso-and-Ridge.jpg?fit=736%2C531&ssl=1\",\"width\":736,\"height\":531},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#webpage\",\"url\":\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/\",\"name\":\"Machine Learning : Regularization - Ridge, Lasso, & Elastic Net Simplified (Part 2) &ndash; YOU CANalytics |\",\"isPartOf\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#primaryimage\"},\"datePublished\":\"2018-04-28T08:30:19+00:00\",\"dateModified\":\"2018-08-21T05:41:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ucanalytics.com\/blogs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Machine Learning : Regularization &#8211; Ridge, Lasso, &#038; Elastic Net Simplified (Part 2)\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#webpage\"},\"author\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#\/schema\/person\/55961a1cea272ecdf290cb387be069b6\"},\"headline\":\"Machine Learning : Regularization &#8211; Ridge, Lasso, &#038; Elastic Net Simplified (Part 2)\",\"datePublished\":\"2018-04-28T08:30:19+00:00\",\"dateModified\":\"2018-08-21T05:41:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#webpage\"},\"wordCount\":1843,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#organization\"},\"image\":{\"@id\":\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Regularization-Lasso-and-Ridge.jpg?fit=736%2C531&ssl=1\",\"articleSection\":[\"Machine Learning and Artificial Intelligence\",\"Regularization and Cross Validation\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#\/schema\/person\/55961a1cea272ecdf290cb387be069b6\",\"name\":\"Roopam Upadhyay\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ucanalytics.com\/blogs\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/dd1aa0b0e813f7639800bcfad6a554f1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/dd1aa0b0e813f7639800bcfad6a554f1?s=96&d=mm&r=g\",\"caption\":\"Roopam Upadhyay\"},\"description\":\"This blog contains my personal views and thoughts on predictive Analytics and big data. - Roopam Upadhyay\",\"sameAs\":[\"roopam\"],\"url\":\"https:\/\/ucanalytics.com\/blogs\/author\/roopam\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Machine Learning : Regularization - Ridge, Lasso, & Elastic Net Simplified (Part 2) &ndash; YOU CANalytics |","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:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/","og_locale":"en_US","og_type":"article","og_title":"Machine Learning : Regularization - Ridge, Lasso, & Elastic Net Simplified (Part 2) &ndash; YOU CANalytics |","og_description":"In the previous article, we started with the theme that\u00a0overfitting is an inherent problem in machine learning associated with big data. Essentially, if you have many variables and their\u00a0polynomial\u00a0terms (X-variables) in a model you could fit any response data (y-variable) to perfection. This perfect fit for the observed data is overfitting since this model willRead More...","og_url":"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/","og_site_name":"YOU CANalytics |","article_author":"roopam","article_published_time":"2018-04-28T08:30:19+00:00","article_modified_time":"2018-08-21T05:41:12+00:00","og_image":[{"width":736,"height":531,"url":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Regularization-Lasso-and-Ridge.jpg?fit=736%2C531&ssl=1","type":"image\/jpeg"}],"twitter_misc":{"Written by":"Roopam Upadhyay","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/ucanalytics.com\/blogs\/#organization","name":"YOU CANalytics","url":"https:\/\/ucanalytics.com\/blogs\/","sameAs":[],"logo":{"@type":"ImageObject","@id":"https:\/\/ucanalytics.com\/blogs\/#logo","inLanguage":"en-US","url":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2015\/11\/YOU-CANalytics-Logo.jpg?fit=607%2C120","contentUrl":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2015\/11\/YOU-CANalytics-Logo.jpg?fit=607%2C120","width":607,"height":120,"caption":"YOU CANalytics"},"image":{"@id":"https:\/\/ucanalytics.com\/blogs\/#logo"}},{"@type":"WebSite","@id":"https:\/\/ucanalytics.com\/blogs\/#website","url":"https:\/\/ucanalytics.com\/blogs\/","name":"YOU CANalytics |","description":"Explore the Power of Data Science","publisher":{"@id":"https:\/\/ucanalytics.com\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ucanalytics.com\/blogs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#primaryimage","inLanguage":"en-US","url":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Regularization-Lasso-and-Ridge.jpg?fit=736%2C531&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Regularization-Lasso-and-Ridge.jpg?fit=736%2C531&ssl=1","width":736,"height":531},{"@type":"WebPage","@id":"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#webpage","url":"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/","name":"Machine Learning : Regularization - Ridge, Lasso, & Elastic Net Simplified (Part 2) &ndash; YOU CANalytics |","isPartOf":{"@id":"https:\/\/ucanalytics.com\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#primaryimage"},"datePublished":"2018-04-28T08:30:19+00:00","dateModified":"2018-08-21T05:41:12+00:00","breadcrumb":{"@id":"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ucanalytics.com\/blogs\/"},{"@type":"ListItem","position":2,"name":"Machine Learning : Regularization &#8211; Ridge, Lasso, &#038; Elastic Net Simplified (Part 2)"}]},{"@type":"Article","@id":"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#article","isPartOf":{"@id":"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#webpage"},"author":{"@id":"https:\/\/ucanalytics.com\/blogs\/#\/schema\/person\/55961a1cea272ecdf290cb387be069b6"},"headline":"Machine Learning : Regularization &#8211; Ridge, Lasso, &#038; Elastic Net Simplified (Part 2)","datePublished":"2018-04-28T08:30:19+00:00","dateModified":"2018-08-21T05:41:12+00:00","mainEntityOfPage":{"@id":"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#webpage"},"wordCount":1843,"commentCount":2,"publisher":{"@id":"https:\/\/ucanalytics.com\/blogs\/#organization"},"image":{"@id":"https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Regularization-Lasso-and-Ridge.jpg?fit=736%2C531&ssl=1","articleSection":["Machine Learning and Artificial Intelligence","Regularization and Cross Validation"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ucanalytics.com\/blogs\/machine-learning-regularization-ridge-lasso-elastic-net-simplified-part-2\/#respond"]}]},{"@type":"Person","@id":"https:\/\/ucanalytics.com\/blogs\/#\/schema\/person\/55961a1cea272ecdf290cb387be069b6","name":"Roopam Upadhyay","image":{"@type":"ImageObject","@id":"https:\/\/ucanalytics.com\/blogs\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/dd1aa0b0e813f7639800bcfad6a554f1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dd1aa0b0e813f7639800bcfad6a554f1?s=96&d=mm&r=g","caption":"Roopam Upadhyay"},"description":"This blog contains my personal views and thoughts on predictive Analytics and big data. - Roopam Upadhyay","sameAs":["roopam"],"url":"https:\/\/ucanalytics.com\/blogs\/author\/roopam\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Regularization-Lasso-and-Ridge.jpg?fit=736%2C531&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3L0jT-2MR","jetpack-related-posts":[{"id":10702,"url":"https:\/\/ucanalytics.com\/blogs\/machine-learning-non-linear-regression-regularization-cross-validation-simplified-part-1\/","url_meta":{"origin":10717,"position":0},"title":"Machine Learning: Non-linear Regression, Regularization &#038; Cross Validation Simplified  (Part 1)","author":"Roopam Upadhyay","date":false,"format":false,"excerpt":"In this 3-part series of articles, you will gain an intuitive understanding of some fundamental concepts in machine learning such as: Building blocks of curves Non-linear regression Curve fitting and overfitting Regularization to prevent overfitting Hyper-parameters in machine learning Cross-validation to fine-tune models You will also get hands-on practice to\u2026","rel":"","context":"In &quot;Machine Learning and Artificial Intelligence&quot;","block_context":{"text":"Machine Learning and Artificial Intelligence","link":"https:\/\/ucanalytics.com\/blogs\/category\/machine-learning-and-artificial-intelligence\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Machine-Learning-Regularization-Simplified-Front-Page.jpg?fit=928%2C522&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Machine-Learning-Regularization-Simplified-Front-Page.jpg?fit=928%2C522&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Machine-Learning-Regularization-Simplified-Front-Page.jpg?fit=928%2C522&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2017\/12\/Machine-Learning-Regularization-Simplified-Front-Page.jpg?fit=928%2C522&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":10774,"url":"https:\/\/ucanalytics.com\/blogs\/machine-learning-cross-validation-and-hyper-parameter-tuning-part-3\/","url_meta":{"origin":10717,"position":1},"title":"Machine Learning : Cross Validation and Hyper-Parameter Tuning (Part 3)","author":"Roopam Upadhyay","date":false,"format":false,"excerpt":"In the last part of this series on fundamental machine learning, you learned about\u00a0regularization and cross-validation. Here, you will gain a sound understanding of model hyper-parameter tuning to develop robust\u00a0models. The machines do learn but they still need a good human tutor. In the last part, you were also introduced\u2026","rel":"","context":"In &quot;Machine Learning and Artificial Intelligence&quot;","block_context":{"text":"Machine Learning and Artificial Intelligence","link":"https:\/\/ucanalytics.com\/blogs\/category\/machine-learning-and-artificial-intelligence\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/01\/Cross-Validation-and-Hyperparameter-Tuning-Cover-3.jpg?fit=746%2C560&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/01\/Cross-Validation-and-Hyperparameter-Tuning-Cover-3.jpg?fit=746%2C560&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/01\/Cross-Validation-and-Hyperparameter-Tuning-Cover-3.jpg?fit=746%2C560&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/01\/Cross-Validation-and-Hyperparameter-Tuning-Cover-3.jpg?fit=746%2C560&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":8388,"url":"https:\/\/ucanalytics.com\/blogs\/regression-analysis-pricing-case-study-example-part-1\/","url_meta":{"origin":10717,"position":2},"title":"Regression Analysis &#8211; Pricing Case Study Example (Part 1)","author":"Roopam Upadhyay","date":false,"format":false,"excerpt":"How to figure out if you are paying the right price for the property you are about to purchase? Welcome to a new data science case study example on YOU CANalytics to identify the right housing price. Pricing is a highly important and\u00a0specialized function for any business. A right price\u2026","rel":"","context":"In &quot;Pricing Case Study Example&quot;","block_context":{"text":"Pricing Case Study Example","link":"https:\/\/ucanalytics.com\/blogs\/category\/pricing-case-study-example\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2016\/07\/Connect-the-Dots.jpg?fit=397%2C603&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":7923,"url":"https:\/\/ucanalytics.com\/blogs\/intuitive-machine-learning-gradient-descent-simplified\/","url_meta":{"origin":10717,"position":3},"title":"Intuitive Machine Learning : Gradient Descent Simplified","author":"Roopam Upadhyay","date":false,"format":false,"excerpt":"How do machines learn? They learn the same way as humans. Humans learn from experience and so do machines. For machines, the experience is in the form of data. Machines use powerful algorithms to make sense of the data. They identify underlining patterns within the data to learn things about\u2026","rel":"","context":"In &quot;Gradient Descent&quot;","block_context":{"text":"Gradient Descent","link":"https:\/\/ucanalytics.com\/blogs\/category\/gradient-descent\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2016\/03\/Rplot01.png?fit=1000%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2016\/03\/Rplot01.png?fit=1000%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2016\/03\/Rplot01.png?fit=1000%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2016\/03\/Rplot01.png?fit=1000%2C600&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":11578,"url":"https:\/\/ucanalytics.com\/blogs\/deep-learning-models-simplified-part-3\/","url_meta":{"origin":10717,"position":4},"title":"Deep Learning Models Simplified (Part 3)","author":"Roopam Upadhyay","date":false,"format":false,"excerpt":"Facebook was a major sensation and a source of great amusement in a British\u00a0country house in the early 20th century. It was such a big hit that it got a special mention in a newspaper published in the year 1902. Facebook, then, of course, had a completely different meaning than\u2026","rel":"","context":"In &quot;Deep Learning Neural Networks&quot;","block_context":{"text":"Deep Learning Neural Networks","link":"https:\/\/ucanalytics.com\/blogs\/category\/deep-learning-neural-networks\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/10\/Popeye-Deep-Learning.jpg?fit=960%2C686&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/10\/Popeye-Deep-Learning.jpg?fit=960%2C686&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/10\/Popeye-Deep-Learning.jpg?fit=960%2C686&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2018\/10\/Popeye-Deep-Learning.jpg?fit=960%2C686&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":2374,"url":"https:\/\/ucanalytics.com\/blogs\/learn-r-12-books-and-online-resources\/","url_meta":{"origin":10717,"position":5},"title":"Learn R : 12 Free Books and Online Resources","author":"Roopam Upadhyay","date":false,"format":false,"excerpt":"Please read the disclaimer about the Free PDF Books in this article at the bottom R, an open-source statistical and data mining programming language, is slowly but surely catching up in its race with commercial software like SAS & SPSS. I believe R will eventually replace SAS as the language\u2026","rel":"","context":"In &quot;Analytics Book Club&quot;","block_context":{"text":"Analytics Book Club","link":"https:\/\/ucanalytics.com\/blogs\/category\/analytics-book-club\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2013\/07\/5-Swordsmith1.jpg?fit=768%2C1024&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2013\/07\/5-Swordsmith1.jpg?fit=768%2C1024&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2013\/07\/5-Swordsmith1.jpg?fit=768%2C1024&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/ucanalytics.com\/blogs\/wp-content\/uploads\/2013\/07\/5-Swordsmith1.jpg?fit=768%2C1024&ssl=1&resize=700%2C400 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/posts\/10717"}],"collection":[{"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/comments?post=10717"}],"version-history":[{"count":0,"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/posts\/10717\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/media\/10718"}],"wp:attachment":[{"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/media?parent=10717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/categories?post=10717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ucanalytics.com\/blogs\/wp-json\/wp\/v2\/tags?post=10717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}