{"id":7074,"date":"2026-09-12T17:25:28","date_gmt":"2026-09-12T22:25:28","guid":{"rendered":"https:\/\/ykim.synology.me\/wordpress\/regularization-7074\/"},"modified":"2026-11-25T16:55:43","modified_gmt":"2026-11-25T22:55:43","slug":"regularization","status":"publish","type":"post","link":"https:\/\/ykim.synology.me\/wordpress\/regularization-7074\/","title":{"rendered":"Regularization"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/github.com\/yBarn1\/Images\/blob\/main\/coupons\/cvs-vaccination-5-off-20-coupon-pair.jpg?raw=true\" alt=\"\" style=\"width:auto;height:500px\"\/><\/figure>\n\n\n<p><div class=\"github-readme-container markdown-body\"><div id=\"file\" class=\"md\" data-path=\"Regression\/Regularization\/regularization-ko.md\"><article class=\"markdown-body entry-content container-lg\" itemprop=\"text\"><div class=\"markdown-heading\" dir=\"auto\"><h1 class=\"heading-element\" dir=\"auto\">Regularization<\/h1><a id=\"user-content-regularization\" class=\"anchor\" aria-label=\"Permalink: Regularization\" href=\"#regularization\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Version 8 | Created: 2026-09-12 | Updated: 2026-11-07 13:46 UTC<\/p>\n<ul dir=\"auto\">\n<li><a href=\"#1-purpose\">1. Purpose<\/a><\/li>\n<li><a href=\"#2-summary\">2. Summary<\/a><\/li>\n<li><a href=\"#3-cause-of-the-problem\">3. Cause of the Problem<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#31-singular-matrix\">3.1 Singular Matrix<\/a><\/li>\n<li><a href=\"#32-high-multicollinearity\">3.2 High Multicollinearity<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#4-penalized-loss\">4. Penalized Loss<\/a>\n<ul dir=\"auto\">\n<li><a href=\"#41-ridge-regression\">4.1 Ridge Regression<\/a><\/li>\n<li><a href=\"#42-lasso-regression\">4.2 Lasso Regression<\/a><\/li>\n<li><a href=\"#43-elasticnet\">4.3 ElasticNet<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#5-comparison\">5. Comparison<\/a><\/li>\n<li><a href=\"#6-dimension-reduction-and-variable-removal\">6. Dimension Reduction and Variable Removal<\/a><\/li>\n<li><a href=\"#appendix-a-terminology\">Appendix A. Terminology<\/a><\/li>\n<li><a href=\"#appendix-b-worked-example\">Appendix B. Worked Example<\/a><\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">1. Purpose<\/h2><a id=\"user-content-1-purpose\" class=\"anchor\" aria-label=\"Permalink: 1. Purpose\" href=\"#1-purpose\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<ul dir=\"auto\">\n<li>\n<strong>Problem Statement<\/strong>: \uc120\ud615 \ud68c\uadc0\uc5d0\uc11c <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$X^\\top X$<\/math-renderer> \uc758 \uc5ed\ud589\ub82c\uc774 \uc874\uc7ac\ud558\uc9c0 \uc54a\uac70\ub098, \uc874\uc7ac\ud558\ub354\ub77c\ub3c4 \ubd88\uc548\uc815\ud55c \ud604\uc0c1\uc740 \ub370\uc774\ud130 \ubd84\uc11d\uc5d0\uc11c \uc790\uc8fc \ub9c8\uc8fc\uce58\ub294 \ubb38\uc81c\ub2e4. \uc55e\uc758 \uacbd\uc6b0 \uacc4\uc218\ub97c \uc0b0\ucd9c\ud560 \uc218 \uc5c6\uace0, \ub4a4\uc758 \uacbd\uc6b0 \ub370\uc774\ud130\uc758 \uc791\uc740 \ubcc0\ud654\uc5d0\ub3c4 \ud68c\uadc0\uacc4\uc218\uac00 \ud06c\uac8c \ud754\ub4e4\ub9b0\ub2e4.<\/li>\n<li>\n<strong>Goal<\/strong>: \uc5ed\ud589\ub82c\uc774 \uc874\uc7ac\ud558\uc9c0 \uc54a\ub294 \uc870\uac74\uacfc \ub2e4\uc911\uacf5\uc120\uc131 (multicollinearity) \uc774 \ub192\uc740 \uc870\uac74\uc744 \uad6c\ubd84\ud558\uace0, \ube44\uc6a9\ud568\uc218\uc5d0 penalty \ub97c \ub354\ud558\ub294 \uc138 \uac00\uc9c0 \ubc29\ubc95 (Ridge, Lasso, ElasticNet) \uc911 \ubb34\uc5c7\uc744 \uc5b4\ub290 \ub370\uc774\ud130\uc5d0 \uc4f8\uc9c0 \uc815\ud55c\ub2e4.<\/li>\n<li>\n<strong>Non-Goal<\/strong>: Penalty \uacc4\uc218 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$\\lambda$<\/math-renderer> \ub97c \uace0\ub974\ub294 \uc808\ucc28\ub294 \ub2e4\ub8e8\uc9c0 \uc54a\ub294\ub2e4.<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">2. Summary<\/h2><a id=\"user-content-2-summary\" class=\"anchor\" aria-label=\"Permalink: 2. Summary\" href=\"#2-summary\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\uc138 \uaddc\uc81c\ud654 (regularization) \ubc29\ubc95\uc740 penalty \ud56d\uc758 \ud615\ud0dc\ub85c \uac08\ub9ac\uba70, \uadf8 \ud615\ud0dc\uac00 \uacc4\uc218\ub97c 0 \uc73c\ub85c \ub9cc\ub4e4 \uc218 \uc788\ub294\uc9c0\ub97c \uc815\ud55c\ub2e4. Ridge \ub294 L2 penalty \ub85c \uacc4\uc218\ub97c 0 \uc5d0 \uac00\uae5d\uac8c \uc904\uc774\ub418 0 \uc73c\ub85c \ub9cc\ub4e4\uc9c0\ub294 \uc54a\uace0, Lasso \ub294 L1 penalty \ub85c \ubd88\ud544\uc694\ud55c \ubcc0\uc218\uc758 \uacc4\uc218\ub97c \uc644\uc804\ud788 0 \uc73c\ub85c \ub9cc\ub4e4\uba70, ElasticNet \uc740 \ub458\uc744 \uacb0\ud569\ud558\uc5ec \uc0c1\uad00\uad00\uacc4\uac00 \ub192\uc740 \ubcc0\uc218 \uadf8\ub8f9\uc744 \ud568\uaed8 \ub2e4\ub8ec\ub2e4. \uc120\ud0dd \uae30\uc900\uc740 Table 1 \uc5d0 \uc788\ub2e4. \uaddc\uc81c\ud654 \ub300\uc2e0 \ubcc0\uc218\ub97c \uc9c1\uc811 \uc904\uc774\ub294 \ubc29\ubc95\uc740 section 6 \uc5d0 \uc788\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">3. Cause of the Problem<\/h2><a id=\"user-content-3-cause-of-the-problem\" class=\"anchor\" aria-label=\"Permalink: 3. Cause of the Problem\" href=\"#3-cause-of-the-problem\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">3.1 Singular Matrix<\/h3><a id=\"user-content-31-singular-matrix\" class=\"anchor\" aria-label=\"Permalink: 3.1 Singular Matrix\" href=\"#31-singular-matrix\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\ud589\ub82c <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$X^\\top X$<\/math-renderer> \uc758 \uc5ed\ud589\ub82c <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$(X^\\top X)^{-1}$<\/math-renderer> \uc774 \uc874\uc7ac\ud558\ub824\uba74 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$X^\\top X$<\/math-renderer> \uac00 \uc804\uc704\uc218 (full rank) \uc5ec\uc57c \ud55c\ub2e4. \ub2e4\uc74c\uacfc \uac19\uc740 \uacbd\uc6b0 \uc5ed\ud589\ub82c\uc774 \uc874\uc7ac\ud558\uc9c0 \uc54a\uc73c\uba70 (\ud2b9\uc774 \ud589\ub82c, singular matrix), \uacc4\uc218\ub97c \uc0b0\ucd9c\ud560 \uc218 \uc5c6\ub2e4.<\/p>\n<ul dir=\"auto\">\n<li>\n<strong>\ud2b9\uc131 (feature) \uc218 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$\\gt$<\/math-renderer> \uad00\uce21\uce58 \uc218 (<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$p \\gt n$<\/math-renderer>)<\/strong>: \ubcc0\uc218\uac00 \ub370\uc774\ud130 \uac1c\uc218\ubcf4\ub2e4 \ub9ce\uc740 \uacbd\uc6b0. \uc720\uc804\uc790 \ub370\uc774\ud130, \ud14d\uc2a4\ud2b8 \uace0\ucc28\uc6d0 \ub370\uc774\ud130.<\/li>\n<li>\n<strong>\uc644\uc804 \ub2e4\uc911\uacf5\uc120\uc131 (perfect multicollinearity)<\/strong>: \ud55c \ubcc0\uc218\uac00 \ub2e4\ub978 \ubcc0\uc218\ub4e4\uc758 \uc644\ubcbd\ud55c \uc120\ud615 \uc870\ud569\uc73c\ub85c \ud45c\ud604\ub418\ub294 \uacbd\uc6b0 (<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$x_2 = 2x_1$<\/math-renderer>).<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">3.2 High Multicollinearity<\/h3><a id=\"user-content-32-high-multicollinearity\" class=\"anchor\" aria-label=\"Permalink: 3.2 High Multicollinearity\" href=\"#32-high-multicollinearity\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\ubcc0\uc218 \uac04 \uc0c1\uad00\uad00\uacc4\uac00 \ub9e4\uc6b0 \ub192\uc73c\uba74 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$X^\\top X$<\/math-renderer> \uc758 \ud589\ub82c\uc2dd (determinant) \uc774 0 \uc5d0 \uac00\uae4c\uc6cc\uc9c4\ub2e4. \uc774\ub85c \uc778\ud574 \uc5ed\ud589\ub82c \uc694\uc18c\uac00 \ub9e4\uc6b0 \ucee4\uc838, \ub370\uc774\ud130\uc758 \uc791\uc740 \ubcc0\ud654\uc5d0\ub3c4 \ud68c\uadc0\uacc4\uc218 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$\\hat{\\beta}$<\/math-renderer> \uac00 \uadf9\ub2e8\uc801\uc73c\ub85c \ub110\ub6f0\ub294 \ud604\uc0c1\uc774 \ubc1c\uc0dd\ud558\uba70 model \uc758 \ubd84\uc0b0 (variance) \uc774 \ucee4\uc9c4\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">4. Penalized Loss<\/h2><a id=\"user-content-4-penalized-loss\" class=\"anchor\" aria-label=\"Permalink: 4. Penalized Loss\" href=\"#4-penalized-loss\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Section 3 \uc758 \ub450 \ubb38\uc81c\ub97c \ud574\uacb0\ud558\ub294 \ub300\ud45c\uc801\uc778 \ubc29\ubc95\uc740 \ube44\uc6a9\ud568\uc218 (loss function) \uc5d0 \uacc4\uc218\uc758 \ud06c\uae30\uc5d0 \ub300\ud55c penalty \ub97c \ub354\ud574, <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$X^\\top X$<\/math-renderer> \ud589\ub82c\uc744 \uac15\uc81c\ub85c \uc5ed\ud589\ub82c \uacc4\uc0b0\uc774 \uac00\ub2a5\ud55c \uad6c\uc870\ub85c \ubcc0\ud615\ud558\ub294 \uac83\uc774\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">4.1 Ridge Regression<\/h3><a id=\"user-content-41-ridge-regression\" class=\"anchor\" aria-label=\"Permalink: 4.1 Ridge Regression\" href=\"#41-ridge-regression\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Ridge \ub294 \uae30\uc874 \uc794\ucc28 \uc81c\uacf1\ud569 (<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$RSS$<\/math-renderer>) \uc5d0 \uacc4\uc218 \uc81c\uacf1\ud569 (L2 norm \uc758 \uc81c\uacf1) \uc744 penalty \ub85c \ucd94\uac00\ud55c\ub2e4.<\/p>\n<math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$$\\mathrm{Loss}_{\\mathrm{Ridge}} = \\|y - X\\beta\\|_2^2 + \\lambda \\|\\beta\\|_2^2 = (y - X\\beta)^\\top (y - X\\beta) + \\lambda \\beta^\\top \\beta\n\\hspace{19em} (1)$$<\/math-renderer>\n<p dir=\"auto\">\uc815\uaddc\ubc29\uc815\uc2dd\uc758 \ud574\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$$\\hat{\\beta}_{\\mathrm{Ridge}} = (X^\\top X + \\lambda I)^{-1} X^\\top y\n\\hspace{19em} (2)$$<\/math-renderer>\n<ul dir=\"auto\">\n<li>\n<strong>\uc5ed\ud589\ub82c \ubcf4\uc7a5<\/strong>: \ub300\uac01\uc120\uc5d0 \ub354\ud55c <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$\\lambda I$<\/math-renderer> (<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$\\lambda \\gt 0$<\/math-renderer>) \ub85c \ud56d\uc0c1 \uc5ed\ud589\ub82c\uc744 \uac16\ub294 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$X^\\top X + \\lambda I$<\/math-renderer>.<\/li>\n<li>\n<strong>\uacc4\uc218 \ucd95\uc18c (shrinkage)<\/strong>: \uacc4\uc218\uc758 \ud06c\uae30\ub97c \uc804\uccb4\uc801\uc73c\ub85c 0 \uc5d0 \uac00\uae5d\uac8c \uc904\uc774\ub418, 0 \uc73c\ub85c \uc644\uc804\ud788 \ub9cc\ub4e4\uc9c0\ub294 \uc54a\ub294 \ud6a8\uacfc.<\/li>\n<li>\n<strong>\uc801\uc6a9 \ub300\uc0c1<\/strong>: \ubcc0\uc218\uc758 \uac1c\uc218\uac00 \ub9ce\uace0 \ub2e4\uc911\uacf5\uc120\uc131\uc774 \uc804\ubc18\uc801\uc73c\ub85c \uc874\uc7ac\ud558\ub294 \uacbd\uc6b0.<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">4.2 Lasso Regression<\/h3><a id=\"user-content-42-lasso-regression\" class=\"anchor\" aria-label=\"Permalink: 4.2 Lasso Regression\" href=\"#42-lasso-regression\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Lasso \ub294 \uc794\ucc28 \uc81c\uacf1\ud569 (<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$RSS$<\/math-renderer>) \uc5d0 \uacc4\uc218\uc758 \uc808\ub313\uac12 \ud569 (L1 norm) \uc744 penalty \ub85c \ucd94\uac00\ud55c\ub2e4.<\/p>\n<math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$$\\mathrm{Loss}_{\\mathrm{Lasso}} = \\|y - X\\beta\\|_2^2 + \\lambda \\|\\beta\\|_1 = (y - X\\beta)^\\top (y - X\\beta) + \\lambda \\sum_{j=1}^{p} |\\beta_j|\n\\hspace{19em} (3)$$<\/math-renderer>\n<ul dir=\"auto\">\n<li>\n<strong>\ubcc0\uc218 \uc120\ud0dd (feature selection)<\/strong>: \uc911\uc694\ud558\uc9c0 \uc54a\uc740 \ubcc0\uc218\uc758 \ud68c\uadc0\uacc4\uc218\ub97c \uc644\uc804\ud55c 0 \uc73c\ub85c \ub9cc\ub4dc\ub294 \uc131\uc9c8.<\/li>\n<li>\n<strong>\ud76c\uc18c\uc131 (sparsity)<\/strong>: \uacb0\uacfc model \uc774 \ub2e8\uc21c\ud574\uc838 \ub192\uc544\uc9c0\ub294 \ud574\uc11d\ub825.<\/li>\n<li>\n<strong>\ucd5c\uc801\ud654<\/strong>: \ubbf8\ubd84 \ubd88\uac00\ub2a5\ud55c \uc9c0\uc810 (<math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$\\beta = 0$<\/math-renderer>) \ub54c\ubb38\uc5d0 \uc815\uaddc\ubc29\uc815\uc2dd \ub300\uc2e0 \uc4f0\ub294 \uc88c\ud45c \ud558\uac15\ubc95 (coordinate descent) \ub4f1\uc758 \uc218\uce58\uc801 \ucd5c\uc801\ud654 \ubc29\ubc95.<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">4.3 ElasticNet<\/h3><a id=\"user-content-43-elasticnet\" class=\"anchor\" aria-label=\"Permalink: 4.3 ElasticNet\" href=\"#43-elasticnet\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">ElasticNet \uc740 L1 \uaddc\uc81c\uc640 L2 \uaddc\uc81c\ub97c \uacb0\ud569\ud55c \ubc29\uc2dd\uc774\ub2e4.<\/p>\n<math-renderer class=\"js-display-math\" style=\"display: block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$$\\mathrm{Loss}_{\\mathrm{ElasticNet}} = \\|y - X\\beta\\|_2^2 + \\lambda_1 \\|\\beta\\|_1 + \\lambda_2 \\|\\beta\\|_2^2\n\\hspace{19em} (4)$$<\/math-renderer>\n<ul dir=\"auto\">\n<li><strong>\uacb0\ud569<\/strong>: Lasso \uc640 Ridge \uc758 \uc7a5\uc810\uc744 \ud568\uaed8 \ucde8\ud55c \ud615\ud0dc.<\/li>\n<li><strong>\uadf8\ub8f9 \ud6a8\uacfc (group effect)<\/strong>: \uc0c1\uad00\uad00\uacc4\uac00 \ub192\uc740 \ubcc0\uc218 \uc9d1\ud569\uc5d0\uc11c \uadf8\ub8f9 \uc804\uccb4\ub97c \ud568\uaed8 \uc120\ud0dd\ud558\uac70\ub098 \ucd95\uc18c\ud558\ub294 \uc131\uc9c8. Lasso \ub294 \uadf8\uc911 \ud558\ub098\ub9cc \uc784\uc758\ub85c \uc120\ud0dd\ud558\uace0 \ub098\uba38\uc9c0\ub97c 0 \uc73c\ub85c \ub9cc\ub4dc\ub294 \uacbd\ud5a5.<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">5. Comparison<\/h2><a id=\"user-content-5-comparison\" class=\"anchor\" aria-label=\"Permalink: 5. Comparison\" href=\"#5-comparison\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\uc138 \ubc29\ubc95\uc744 \uac00\ub974\ub294 \uac83\uc740 \uacc4\uc218\ub97c \uc644\uc804\ud55c 0 \uc73c\ub85c \ub9cc\ub4dc\ub294\uc9c0\uc774\uba70, \uadf8 \ucc28\uc774\ub294 penalty \uac00 \uadf8\ub9ac\ub294 \uc81c\uc57d \uc601\uc5ed\uc758 \ubaa8\uc591\uc5d0\uc11c \uc628\ub2e4. Penalty \ub97c \ub354\ud574 \ube44\uc6a9\ud568\uc218\ub97c \ucd5c\uc18c\ud654\ud558\ub294 \uac83\uc740 \uacc4\uc218 \ubca1\ud130\ub97c \uc77c\uc815\ud55c \ud06c\uae30 \uc548\uc5d0 \ubb36\uc5b4 \ub450\uace0 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$RSS$<\/math-renderer> \ub97c \ucd5c\uc18c\ud654\ud558\ub294 \uac83\uacfc \uac19\uace0, \uadf8 \ud06c\uae30\ub97c \uc7ac\ub294 norm \uc774 \uc601\uc5ed\uc758 \ubaa8\uc591\uc744 \uc815\ud55c\ub2e4. L1 \uacfc L2 \ub97c \ud3ec\ud568\ud55c norm \uc758 \uc885\ub958\uc640 \uc815\uc758\ub294 <a href=\"https:\/\/github.com\/ykim2718\/Math\/blob\/main\/Linear-Algebra\/Norm-Types\/norm-types-ko.md\">Types of Norms<\/a> \uc5d0 \uc788\ub2e4.<\/p>\n<p dir=\"auto\">\ub450 penalty \uc758 \uc81c\uc57d \uc601\uc5ed\uc740 Fig 1 \uc774\ub2e4.<\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"              b2                                    b2\n              |                                     |\n             \/|\\                                _.--+--._\n            \/ | \\                              \/    |    \\\n      -----+--+--+----- b1              ------+-----+-----+------ b1\n            \\ | \/                              \\    |    \/\n             \\|\/                                '--_+_--'\n              |                                     |\n\n             (a)                                   (b)\"><pre lang=\"text\" class=\"notranslate\"><code>              b2                                    b2\n              |                                     |\n             \/|\\                                _.--+--._\n            \/ | \\                              \/    |    \\\n      -----+--+--+----- b1              ------+-----+-----+------ b1\n            \\ | \/                              \\    |    \/\n             \\|\/                                '--_+_--'\n              |                                     |\n\n             (a)                                   (b)\n<\/code><\/pre><\/div>\n<p dir=\"auto\">Fig 1. Constraint regions of the L1 and L2 penalties<\/p>\n<ul dir=\"auto\">\n<li>\n<strong>(a)<\/strong>: L1 \uc758 \uc81c\uc57d \uc601\uc5ed. \ucd95 \uc704\uc5d0 \uaf2d\uc9d3\uc810\uc774 \uc788\ub294 \ub9c8\ub984\ubaa8\uc774\uba70, <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$RSS$<\/math-renderer> \uc758 \ub4f1\uace0\uc120\uc774 \ucee4\uc9c0\ub2e4\uac00 \ucc98\uc74c \ub2ff\ub294 \uacf3\uc774 \ub300\uac1c \uadf8 \uaf2d\uc9d3\uc810\uc774\ub2e4. \uaf2d\uc9d3\uc810\uc5d0\uc11c\ub294 \ud55c \uacc4\uc218\uac00 \uc815\ud655\ud788 0 \uc774\ub2e4.<\/li>\n<li>\n<strong>(b)<\/strong>: L2 \uc758 \uc81c\uc57d \uc601\uc5ed. \uaf2d\uc9d3\uc810\uc774 \uc5c6\ub294 \uc6d0\uc774\uba70, \ub4f1\uace0\uc120\uc774 \ub2ff\ub294 \uc810\uc740 \ucd95\uc5d0\uc11c \ubc97\uc5b4\ub098 \uc788\uc5b4 \ub450 \uacc4\uc218 \ubaa8\ub450 0 \uc774 \uc544\ub2c8\ub2e4.<\/li>\n<\/ul>\n<p dir=\"auto\">Table 1. Comparison of the three penalties<\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Aspect<\/th>\n<th>Ridge (L2)<\/th>\n<th>Lasso (L1)<\/th>\n<th>ElasticNet (L1 + L2)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Penalty form<\/td>\n<td><math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$\\lambda \\sum \\beta_j^2$<\/math-renderer><\/td>\n<td><math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$\\lambda \\sum \\lvert\\beta_j\\rvert$<\/math-renderer><\/td>\n<td><math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$\\lambda_1 \\sum \\lvert\\beta_j\\rvert + \\lambda_2 \\sum \\beta_j^2$<\/math-renderer><\/td>\n<\/tr>\n<tr>\n<td>Zero coefficient<\/td>\n<td>\uc5c6\uc74c. 0 \uc5d0 \uac00\uae5d\uac8c \ucd95\uc18c<\/td>\n<td>\uc788\uc74c. \uc644\uc804\ud55c 0 \uac00\ub2a5<\/td>\n<td>\uc788\uc74c. \uc644\uc804\ud55c 0 \uac00\ub2a5<\/td>\n<\/tr>\n<tr>\n<td>Main role<\/td>\n<td>\ub2e4\uc911\uacf5\uc120\uc131 \uc644\ud654, \ubd84\uc0b0 \uac10\uc18c<\/td>\n<td>\ubcc0\uc218 \uc120\ud0dd, model \ub2e8\uc21c\ud654<\/td>\n<td>\ub2e4\uc911\uacf5\uc120\uc131 \uc0c1\ud669\uc5d0\uc11c\uc758 \ubcc0\uc218 \uc120\ud0dd<\/td>\n<\/tr>\n<tr>\n<td>Suited data<\/td>\n<td>\ub300\ubd80\ubd84\uc758 \ubcc0\uc218\uac00 \uc720\uc758\ubbf8\ud560 \ub54c<\/td>\n<td>\ubd88\ud544\uc694\ud55c \ubcc0\uc218\uac00 \ub9ce\uc744 \ub54c<\/td>\n<td>\uc0c1\uad00\uad00\uacc4\uac00 \ub192\uc740 \ubcc0\uc218 \uadf8\ub8f9\uc774 \ub9ce\uc744 \ub54c<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\">\uc774 \uc138 \ubc29\ubc95\uacfc OLS \ub97c \uac19\uc740 \ub370\uc774\ud130\uc5d0 \uc801\uc6a9\ud55c \uacb0\uacfc\ub294 <a href=\"#appendix-b-worked-example\">Appendix B<\/a> \uc5d0 \uc788\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">6. Dimension Reduction and Variable Removal<\/h2><a id=\"user-content-6-dimension-reduction-and-variable-removal\" class=\"anchor\" aria-label=\"Permalink: 6. Dimension Reduction and Variable Removal\" href=\"#6-dimension-reduction-and-variable-removal\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Penalty \ub97c \ub354\ud558\ub294 \ub300\uc2e0 \ubcc0\uc218 \uc790\uccb4\ub97c \uc904\uc774\ub294 \ubc29\ubc95\uc774 \ub450 \uac00\uc9c0 \uc788\ub2e4.<\/p>\n<ul dir=\"auto\">\n<li><strong>VIF (Variance Inflation Factor) \uae30\ubc18 \ubcc0\uc218 \uc81c\uac70<\/strong>: \uacf5\uc120\uc131\uc774 \ub192\uc740, VIF \uac00 10 \uc774\uc0c1\uc778 \ubcc0\uc218\uc758 \uc9c1\uc811 \uc81c\uac70.<\/li>\n<li><strong>PCA (\uc8fc\uc131\ubd84 \ubd84\uc11d) \ud68c\uadc0<\/strong>: \uc11c\ub85c \uc9c1\uad50 (orthogonal) \ud558\ub294 \uc8fc\uc131\ubd84 (principal component) \uc73c\ub85c \uae30\uc874 \ubcc0\uc218\ub97c \ub300\uccb4\ud558\uc5ec \ub2e4\uc911\uacf5\uc120\uc131\uc744 \uc5c6\uc560\ub294 \ubc29\ubc95.<\/li>\n<\/ul>\n<hr>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">Appendix A. Terminology<\/h2><a id=\"user-content-appendix-a-terminology\" class=\"anchor\" aria-label=\"Permalink: Appendix A. Terminology\" href=\"#appendix-a-terminology\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<ul dir=\"auto\">\n<li><strong>determinant<\/strong>: \uc815\ubc29\ud589\ub82c\uc5d0 \ub300\uc751\ud558\ub294 \uc2a4\uce7c\ub77c \uac12. 0 \uc774\uba74 \uc5ed\ud589\ub82c\uc774 \uc874\uc7ac\ud558\uc9c0 \uc54a\ub294\ub2e4.<\/li>\n<li><strong>full rank<\/strong>: \ud589\ub82c\uc758 rank \uac00 \uadf8 \ud589\ub82c\uc774 \uac00\uc9c8 \uc218 \uc788\ub294 \ucd5c\ub313\uac12\uacfc \uac19\uc740 \uc0c1\ud0dc.<\/li>\n<li><strong>L1 norm<\/strong>: \ubca1\ud130 \uc6d0\uc18c\uc758 \uc808\ub313\uac12 \ud569.<\/li>\n<li><strong>L2 norm<\/strong>: \ubca1\ud130 \uc6d0\uc18c\uc758 \uc81c\uacf1\ud569\uc758 \uc81c\uacf1\uadfc.<\/li>\n<li><strong>multicollinearity<\/strong>: \uc124\uba85 \ubcc0\uc218 \uc0ac\uc774\uc758 \uc120\ud615 \uc0c1\uad00\uad00\uacc4.<\/li>\n<li><strong>regularization<\/strong>: \ube44\uc6a9\ud568\uc218\uc5d0 \uacc4\uc218\uc758 \ud06c\uae30\uc5d0 \ub300\ud55c penalty \ub97c \ub354\ud574 \ud574\ub97c \uc548\uc815\uc2dc\ud0a4\ub294 \ubc29\ubc95.<\/li>\n<li><strong>RSS<\/strong>: Residual Sum of Squares. \uc794\ucc28\uc758 \uc81c\uacf1\ud569.<\/li>\n<li><strong>shrinkage<\/strong>: Penalty \ub85c \uacc4\uc218\uc758 \ud06c\uae30\ub97c 0 \ucabd\uc73c\ub85c \uc904\uc774\ub294 \ud6a8\uacfc.<\/li>\n<li><strong>singular matrix<\/strong>: \uc5ed\ud589\ub82c\uc774 \uc874\uc7ac\ud558\uc9c0 \uc54a\ub294 \uc815\ubc29\ud589\ub82c.<\/li>\n<li><strong>VIF<\/strong>: Variance Inflation Factor. \ud55c \ubcc0\uc218\uac00 \ub2e4\ub978 \ubcc0\uc218\ub4e4\ub85c \uc5bc\ub9c8\ub098 \uc124\uba85\ub418\ub294\uc9c0\ub97c \ub098\ud0c0\ub0b4\ub294 \uacf5\uc120\uc131 \uc9c0\ud45c.<\/li>\n<\/ul>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">Appendix B. Worked Example<\/h2><a id=\"user-content-appendix-b-worked-example\" class=\"anchor\" aria-label=\"Permalink: Appendix B. Worked Example\" href=\"#appendix-b-worked-example\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\uc544\ub798 code \ub294 \uc0c1\uad00\uacc4\uc218\uac00 0.99 \ub97c \ub118\ub294 \ubcc0\uc218 \ub450 \uac1c\uc640 \uc751\ub2f5\uc5d0 \uad00\uc5ec\ud558\uc9c0 \uc54a\ub294 \ubcc0\uc218 \uc138 \uac1c\ub97c \ub2f4\uc740 \uc790\ub8cc\ub97c \ub9cc\ub4e4\uc5b4, section 3 \uc758 \ub450 \uc870\uac74\uacfc section 4 \uc758 \uc138 penalty \uac00 \uacc4\uc218\uc5d0 \ub0a8\uae30\ub294 \ucc28\uc774\ub97c \ud55c \ubc88\uc5d0 \ubcf4\uc778\ub2e4.<\/p>\n<div class=\"highlight highlight-source-python notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# Python\nimport numpy as np\nfrom sklearn.linear_model import LinearRegression, Ridge, Lasso, ElasticNet\n\n# 1. Two nearly collinear features, one useful feature, three that carry nothing\nnp.random.seed(0)\nn_samples = 60\n\nx1 = np.random.randn(n_samples)\nx2 = x1 + 0.01 * np.random.randn(n_samples)\nx3 = np.random.randn(n_samples)\nunrelated = np.random.randn(n_samples, 3)\nX = np.column_stack([x1, x2, x3, unrelated])\n\n# Only x1, x2 and x3 drive the response\ny = 3 * x1 + 3 * x2 + 2 * x3 + 0.5 * np.random.randn(n_samples)\n\nprint(f&quot;corr(x1, x2): {np.corrcoef(x1, x2)[0, 1]:.6f}&quot;)\nprint(f&quot;condition number of X^T X: {np.linalg.cond(X.T @ X):.3e}&quot;)\nprint(&quot;-&quot; * 60)\n\n# 2. More features than observations: X^T X cannot be full rank\nX_wide = np.random.randn(5, 8)\nXtX_wide = X_wide.T @ X_wide\nprint(f&quot;p &gt; n: X^T X is {XtX_wide.shape[0]} x {XtX_wide.shape[1]}, &quot;\n      f&quot;rank {np.linalg.matrix_rank(XtX_wide)}&quot;)\nprint(f&quot;p &gt; n: determinant of X^T X: {np.linalg.det(XtX_wide):.3e}&quot;)\nprint(&quot;-&quot; * 60)\n\n# 3. The same data under the four estimators\nmodels = {\n    &quot;OLS&quot;: LinearRegression(),\n    &quot;Ridge (alpha=1.0)&quot;: Ridge(alpha=1.0),\n    &quot;Lasso (alpha=0.1)&quot;: Lasso(alpha=0.1),\n    &quot;ElasticNet (alpha=0.1, l1_ratio=0.5)&quot;: ElasticNet(alpha=0.1, l1_ratio=0.5),\n}\nfor name, model in models.items():\n    model.fit(X, y)\n    print(f&quot;{name}&quot;)\n    print(f&quot;  coefficients: {np.round(model.coef_, 3)}&quot;)\n    print(f&quot;  exact zeros: {int(np.sum(model.coef_ == 0))}&quot;)\nprint(&quot;-&quot; * 60)\n\n# 4. How far each coefficient vector moves when noise of sd 0.01 is added to y\ny_perturbed = y + 0.01 * np.random.randn(n_samples)\nfor name in (&quot;OLS&quot;, &quot;Ridge (alpha=1.0)&quot;):\n    before = models[name].coef_.copy()\n    after = models[name].fit(X, y_perturbed).coef_\n    print(f&quot;{name}: max coefficient shift {np.max(np.abs(after - before)):.4f}&quot;)\"><pre><span class=\"pl-c\"># Python<\/span>\n<span class=\"pl-k\">import<\/span> <span class=\"pl-s1\">numpy<\/span> <span class=\"pl-k\">as<\/span> <span class=\"pl-s1\">np<\/span>\n<span class=\"pl-k\">from<\/span> <span class=\"pl-s1\">sklearn<\/span>.<span class=\"pl-s1\">linear_model<\/span> <span class=\"pl-k\">import<\/span> <span class=\"pl-v\">LinearRegression<\/span>, <span class=\"pl-v\">Ridge<\/span>, <span class=\"pl-v\">Lasso<\/span>, <span class=\"pl-v\">ElasticNet<\/span>\n\n<span class=\"pl-c\"># 1. Two nearly collinear features, one useful feature, three that carry nothing<\/span>\n<span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">random<\/span>.<span class=\"pl-c1\">seed<\/span>(<span class=\"pl-c1\">0<\/span>)\n<span class=\"pl-s1\">n_samples<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-c1\">60<\/span>\n\n<span class=\"pl-s1\">x1<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">random<\/span>.<span class=\"pl-c1\">randn<\/span>(<span class=\"pl-s1\">n_samples<\/span>)\n<span class=\"pl-s1\">x2<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">x1<\/span> <span class=\"pl-c1\">+<\/span> <span class=\"pl-c1\">0.01<\/span> <span class=\"pl-c1\">*<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">random<\/span>.<span class=\"pl-c1\">randn<\/span>(<span class=\"pl-s1\">n_samples<\/span>)\n<span class=\"pl-s1\">x3<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">random<\/span>.<span class=\"pl-c1\">randn<\/span>(<span class=\"pl-s1\">n_samples<\/span>)\n<span class=\"pl-s1\">unrelated<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">random<\/span>.<span class=\"pl-c1\">randn<\/span>(<span class=\"pl-s1\">n_samples<\/span>, <span class=\"pl-c1\">3<\/span>)\n<span class=\"pl-c1\">X<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">column_stack<\/span>(&#91;<span class=\"pl-s1\">x1<\/span>, <span class=\"pl-s1\">x2<\/span>, <span class=\"pl-s1\">x3<\/span>, <span class=\"pl-s1\">unrelated<\/span>&#93;)\n\n<span class=\"pl-c\"># Only x1, x2 and x3 drive the response<\/span>\n<span class=\"pl-s1\">y<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-c1\">3<\/span> <span class=\"pl-c1\">*<\/span> <span class=\"pl-s1\">x1<\/span> <span class=\"pl-c1\">+<\/span> <span class=\"pl-c1\">3<\/span> <span class=\"pl-c1\">*<\/span> <span class=\"pl-s1\">x2<\/span> <span class=\"pl-c1\">+<\/span> <span class=\"pl-c1\">2<\/span> <span class=\"pl-c1\">*<\/span> <span class=\"pl-s1\">x3<\/span> <span class=\"pl-c1\">+<\/span> <span class=\"pl-c1\">0.5<\/span> <span class=\"pl-c1\">*<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">random<\/span>.<span class=\"pl-c1\">randn<\/span>(<span class=\"pl-s1\">n_samples<\/span>)\n\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"corr(x1, x2): <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">corrcoef<\/span>(<span class=\"pl-s1\">x1<\/span>, <span class=\"pl-s1\">x2<\/span>)&#91;<span class=\"pl-c1\">0<\/span>, <span class=\"pl-c1\">1<\/span>&#93;:.6f<span class=\"pl-kos\">}<\/span><\/span>\"<\/span>)\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"condition number of X^T X: <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">linalg<\/span>.<span class=\"pl-c1\">cond<\/span>(<span class=\"pl-c1\">X<\/span>.<span class=\"pl-c1\">T<\/span> @ <span class=\"pl-c1\">X<\/span>):.3e<span class=\"pl-kos\">}<\/span><\/span>\"<\/span>)\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">\"-\"<\/span> <span class=\"pl-c1\">*<\/span> <span class=\"pl-c1\">60<\/span>)\n\n<span class=\"pl-c\"># 2. More features than observations: X^T X cannot be full rank<\/span>\n<span class=\"pl-v\">X_wide<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">random<\/span>.<span class=\"pl-c1\">randn<\/span>(<span class=\"pl-c1\">5<\/span>, <span class=\"pl-c1\">8<\/span>)\n<span class=\"pl-v\">XtX_wide<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-v\">X_wide<\/span>.<span class=\"pl-c1\">T<\/span> @ <span class=\"pl-v\">X_wide<\/span>\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"p &gt; n: X^T X is <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-v\">XtX_wide<\/span>.<span class=\"pl-c1\">shape<\/span>&#91;<span class=\"pl-c1\">0<\/span>&#93;<span class=\"pl-kos\">}<\/span><\/span> x <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-v\">XtX_wide<\/span>.<span class=\"pl-c1\">shape<\/span>&#91;<span class=\"pl-c1\">1<\/span>&#93;<span class=\"pl-kos\">}<\/span><\/span>, \"<\/span>\n      <span class=\"pl-s\">f\"rank <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">linalg<\/span>.<span class=\"pl-c1\">matrix_rank<\/span>(<span class=\"pl-v\">XtX_wide<\/span>)<span class=\"pl-kos\">}<\/span><\/span>\"<\/span>)\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"p &gt; n: determinant of X^T X: <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">linalg<\/span>.<span class=\"pl-c1\">det<\/span>(<span class=\"pl-v\">XtX_wide<\/span>):.3e<span class=\"pl-kos\">}<\/span><\/span>\"<\/span>)\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">\"-\"<\/span> <span class=\"pl-c1\">*<\/span> <span class=\"pl-c1\">60<\/span>)\n\n<span class=\"pl-c\"># 3. The same data under the four estimators<\/span>\n<span class=\"pl-s1\">models<\/span> <span class=\"pl-c1\">=<\/span> {\n    <span class=\"pl-s\">\"OLS\"<\/span>: <span class=\"pl-en\">LinearRegression<\/span>(),\n    <span class=\"pl-s\">\"Ridge (alpha=1.0)\"<\/span>: <span class=\"pl-en\">Ridge<\/span>(<span class=\"pl-s1\">alpha<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-c1\">1.0<\/span>),\n    <span class=\"pl-s\">\"Lasso (alpha=0.1)\"<\/span>: <span class=\"pl-en\">Lasso<\/span>(<span class=\"pl-s1\">alpha<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-c1\">0.1<\/span>),\n    <span class=\"pl-s\">\"ElasticNet (alpha=0.1, l1_ratio=0.5)\"<\/span>: <span class=\"pl-en\">ElasticNet<\/span>(<span class=\"pl-s1\">alpha<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-c1\">0.1<\/span>, <span class=\"pl-s1\">l1_ratio<\/span><span class=\"pl-c1\">=<\/span><span class=\"pl-c1\">0.5<\/span>),\n}\n<span class=\"pl-k\">for<\/span> <span class=\"pl-s1\">name<\/span>, <span class=\"pl-s1\">model<\/span> <span class=\"pl-c1\">in<\/span> <span class=\"pl-s1\">models<\/span>.<span class=\"pl-c1\">items<\/span>():\n    <span class=\"pl-s1\">model<\/span>.<span class=\"pl-c1\">fit<\/span>(<span class=\"pl-c1\">X<\/span>, <span class=\"pl-s1\">y<\/span>)\n    <span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"<span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-s1\">name<\/span><span class=\"pl-kos\">}<\/span><\/span>\"<\/span>)\n    <span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"  coefficients: <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">round<\/span>(<span class=\"pl-s1\">model<\/span>.<span class=\"pl-c1\">coef_<\/span>, <span class=\"pl-c1\">3<\/span>)<span class=\"pl-kos\">}<\/span><\/span>\"<\/span>)\n    <span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"  exact zeros: <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-en\">int<\/span>(<span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">sum<\/span>(<span class=\"pl-s1\">model<\/span>.<span class=\"pl-c1\">coef_<\/span> <span class=\"pl-c1\">==<\/span> <span class=\"pl-c1\">0<\/span>))<span class=\"pl-kos\">}<\/span><\/span>\"<\/span>)\n<span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">\"-\"<\/span> <span class=\"pl-c1\">*<\/span> <span class=\"pl-c1\">60<\/span>)\n\n<span class=\"pl-c\"># 4. How far each coefficient vector moves when noise of sd 0.01 is added to y<\/span>\n<span class=\"pl-s1\">y_perturbed<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">y<\/span> <span class=\"pl-c1\">+<\/span> <span class=\"pl-c1\">0.01<\/span> <span class=\"pl-c1\">*<\/span> <span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">random<\/span>.<span class=\"pl-c1\">randn<\/span>(<span class=\"pl-s1\">n_samples<\/span>)\n<span class=\"pl-k\">for<\/span> <span class=\"pl-s1\">name<\/span> <span class=\"pl-c1\">in<\/span> (<span class=\"pl-s\">\"OLS\"<\/span>, <span class=\"pl-s\">\"Ridge (alpha=1.0)\"<\/span>):\n    <span class=\"pl-s1\">before<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">models<\/span>&#91;<span class=\"pl-s1\">name<\/span>&#93;.<span class=\"pl-c1\">coef_<\/span>.<span class=\"pl-c1\">copy<\/span>()\n    <span class=\"pl-s1\">after<\/span> <span class=\"pl-c1\">=<\/span> <span class=\"pl-s1\">models<\/span>&#91;<span class=\"pl-s1\">name<\/span>&#93;.<span class=\"pl-c1\">fit<\/span>(<span class=\"pl-c1\">X<\/span>, <span class=\"pl-s1\">y_perturbed<\/span>).<span class=\"pl-c1\">coef_<\/span>\n    <span class=\"pl-en\">print<\/span>(<span class=\"pl-s\">f\"<span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-s1\">name<\/span><span class=\"pl-kos\">}<\/span><\/span>: max coefficient shift <span class=\"pl-s1\"><span class=\"pl-kos\">{<\/span><span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">max<\/span>(<span class=\"pl-s1\">np<\/span>.<span class=\"pl-c1\">abs<\/span>(<span class=\"pl-s1\">after<\/span> <span class=\"pl-c1\">-<\/span> <span class=\"pl-s1\">before<\/span>)):.4f<span class=\"pl-kos\">}<\/span><\/span>\"<\/span>)<\/pre><\/div>\n<p dir=\"auto\">NumPy 2.4.6 \uacfc scikit-learn 1.9.1 \uc5d0\uc11c \uc2e4\ud589\ud55c \uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"corr(x1, x2): 0.999953\ncondition number of X^T X: 4.444e+04\n------------------------------------------------------------\np &gt; n: X^T X is 8 x 8, rank 5\np &gt; n: determinant of X^T X: -3.766e-45\n------------------------------------------------------------\nOLS\n  coefficients: [-0.07   6.225  1.898 -0.105 -0.029  0.039]\n  exact zeros: 0\nRidge (alpha=1.0)\n  coefficients: [ 3.047  3.063  1.867 -0.09  -0.03   0.041]\n  exact zeros: 0\nLasso (alpha=0.1)\n  coefficients: [ 6.067e+00  2.000e-03  1.790e+00 -0.000e+00 -0.000e+00  0.000e+00]\n  exact zeros: 3\nElasticNet (alpha=0.1, l1_ratio=0.5)\n  coefficients: [ 2.996  2.991  1.755 -0.012 -0.004  0.   ]\n  exact zeros: 1\n------------------------------------------------------------\nOLS: max coefficient shift 0.1059\nRidge (alpha=1.0): max coefficient shift 0.0008\"><pre lang=\"text\" class=\"notranslate\"><code>corr(x1, x2): 0.999953\ncondition number of X^T X: 4.444e+04\n------------------------------------------------------------\np &gt; n: X^T X is 8 x 8, rank 5\np &gt; n: determinant of X^T X: -3.766e-45\n------------------------------------------------------------\nOLS\n  coefficients: &#91;-0.07   6.225  1.898 -0.105 -0.029  0.039&#93;\n  exact zeros: 0\nRidge (alpha=1.0)\n  coefficients: &#91; 3.047  3.063  1.867 -0.09  -0.03   0.041&#93;\n  exact zeros: 0\nLasso (alpha=0.1)\n  coefficients: &#91; 6.067e+00  2.000e-03  1.790e+00 -0.000e+00 -0.000e+00  0.000e+00&#93;\n  exact zeros: 3\nElasticNet (alpha=0.1, l1_ratio=0.5)\n  coefficients: &#91; 2.996  2.991  1.755 -0.012 -0.004  0.   &#93;\n  exact zeros: 1\n------------------------------------------------------------\nOLS: max coefficient shift 0.1059\nRidge (alpha=1.0): max coefficient shift 0.0008\n<\/code><\/pre><\/div>\n<p dir=\"auto\">\uacb0\uacfc\uc5d0\uc11c \uc77d\uc744 \uac83\uc740 \ub2e4\uc12f \uac00\uc9c0\ub2e4.<\/p>\n<ul dir=\"auto\">\n<li>\n<strong>\uc5ed\ud589\ub82c \uc5c6\uc74c<\/strong>: \uad00\uce21\uce58 5 \uac1c\uc5d0 \ubcc0\uc218 8 \uac1c\uc778 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$X^\\top X$<\/math-renderer> \uc758 rank 5 \uc640 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$-3.766 \\times 10^{-45}$<\/math-renderer> \uc778 \ud589\ub82c\uc2dd. Section 3.1 \uc774 \ub9d0\ud55c \uc804\uc704\uc218 \ubbf8\ub2ec.<\/li>\n<li>\n<strong>OLS \uc758 \ub110\ub700<\/strong>: \uc0c1\uad00 0.999953 \uc778 \ub450 \ubcc0\uc218\uc5d0 <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$-0.07$<\/math-renderer> \uacfc <math-renderer class=\"js-inline-math\" style=\"display: inline-block\" data-run-id=\"8aebc196850b0ad2562775179d3ac59d\">$6.225$<\/math-renderer> \ub85c \uac08\ub9b0 \uacc4\uc218. \ucc38\uac12\uc740 \ub458 \ub2e4 3 \uc774\uba70, \ud569\uc740 \uc9c0\ucf1c\uc9c0\uace0 \ubc30\ubd84\uc774 \ubb34\ub108\uc9c4 \ubaa8\uc591.<\/li>\n<li>\n<strong>Ridge<\/strong>: 3.047 \uacfc 3.063 \uc73c\ub85c \ucc38\uac12 \uac00\uae4c\uc774 \ubaa8\uc778 \ub450 \uacc4\uc218. \uc644\uc804\ud55c 0 \uc740 \uc5c6\uc74c.<\/li>\n<li>\n<strong>Lasso<\/strong>: \ub450 \ubcc0\uc218 \uc911 \ud558\ub098\ub9cc 6.067 \ub85c \ub0a8\uae30\uace0 \ub2e4\ub978 \ud558\ub098\ub97c 0.002 \ub85c \ub204\ub978 \uacb0\uacfc, \uadf8\ub9ac\uace0 \uc751\ub2f5\uc5d0 \uad00\uc5ec\ud558\uc9c0 \uc54a\ub294 \ubcc0\uc218 \uc138 \uac1c\uc758 \uc644\uc804\ud55c 0.<\/li>\n<li>\n<strong>ElasticNet<\/strong>: 2.996 \uacfc 2.991 \ub85c \ub450 \ubcc0\uc218\ub97c \ud568\uaed8 \ub0a8\uae34 \uadf8\ub8f9 \ud6a8\uacfc.<\/li>\n<\/ul>\n<p dir=\"auto\">\uc751\ub2f5\uc5d0 \ud45c\uc900\ud3b8\ucc28 0.01 \uc758 \uc7a1\uc74c\uc744 \ub354\ud574 \ub2e4\uc2dc \uc801\ud569\ud588\uc744 \ub54c \uacc4\uc218\uc758 \ucd5c\ub300 \uc774\ub3d9\uc740 OLS \uac00 0.1059, Ridge \uac00 0.0008 \uc774\ub2e4. Section 3.2 \uac00 \ub9d0\ud55c \ubd84\uc0b0\uc758 \ucc28\uc774\uac00 \uc774 \ub450 \uc218\uc5d0 \uadf8\ub300\ub85c \ub098\ud0c0\ub09c\ub2e4.<\/p>\n<\/article><\/div><\/div><\/p>\n<div style='text-align:center' class='yasr-auto-insert-overall'><\/div><div style='text-align:center' class='yasr-auto-insert-visitor'><\/div>","protected":false},"excerpt":{"rendered":"<p>When the cross-product matrix cannot be inverted, or barely can, a penalty added to the loss stabilizes the coefficients. Which penalty matters: Ridge shrinks toward zero but never reaches it, Lasso drives useless variables exactly to zero, and ElasticNet handles groups of correlated variables. Dropping variables outright, by VIF or PCA, is the alternative.<\/p>\n","protected":false},"author":4,"featured_media":7075,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","yasr_overall_rating":0,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","fifu_image_url":"","fifu_image_alt":"","iawp_total_views":8,"footnotes":""},"categories":[56,373],"tags":[386,429],"class_list":["post-7074","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-science-slug","category-feature-engineering-slug","tag-github-hosted","tag-regularization"],"yasr_visitor_votes":{"stars_attributes":{"read_only":false,"span_bottom":false},"number_of_votes":0,"sum_votes":0},"jetpack_featured_media_url":"https:\/\/ykim.synology.me\/wordpress\/wp-content\/uploads\/2026\/09\/cvs-vaccination-5-off-20-coupon-pair.jpg","_links":{"self":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/7074","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/comments?post=7074"}],"version-history":[{"count":2,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/7074\/revisions"}],"predecessor-version":[{"id":7367,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/7074\/revisions\/7367"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/media\/7075"}],"wp:attachment":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/media?parent=7074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/categories?post=7074"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/tags?post=7074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}