{"id":20019,"date":"2024-04-10T12:16:00","date_gmt":"2024-04-10T06:46:00","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/"},"modified":"2024-10-15T00:11:09","modified_gmt":"2024-10-14T18:41:09","slug":"understanding-of-lasso-regression","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/","title":{"rendered":"A Complete understanding of LASSO Regression"},"content":{"rendered":"\n<p><strong>Contributed by: <a href=\"https:\/\/www.linkedin.com\/in\/dinesh-kumar-2169aa81\" target=\"_blank\" rel=\"nofollow noreferrer noopener\">Dinesh Kumar<\/a> <\/strong><\/p>\n\n\n\n<p>We hope you've had a chance to go through our previous articles on <a href=\"https:\/\/www.mygreatlearning.com\/blog\/what-is-ridge-regression\/\">regression<\/a> and <a href=\"https:\/\/www.mygreatlearning.com\/blog\/what-is-ridge-regression\/\" target=\"_blank\" rel=\"noreferrer noopener\">ridge regression.<\/a> Building on that foundation, it's now time to explore lasso regression. <\/p>\n\n\n\n<p>Like its predecessors, lasso regression is a powerful tool for <a href=\"https:\/\/www.mygreatlearning.com\/blog\/what-is-predictive-modeling\/\">predictive modeling<\/a>, but it comes with its unique twist\u2014penalizing the absolute size of the regression coefficients.<\/p>\n\n\n\n<p>Understanding all three methods together not only deepens your knowledge of statistical techniques but also equips you with a versatile toolkit for tackling real-world data challenges.<\/p>\n\n\n\n<p>This article will delve into why lasso regression is essential and how it complements the techniques we\u2019ve previously discussed. If you're looking to enhance your skills further, enrolling in a <strong><a href=\"https:\/\/www.mygreatlearning.com\/pg-program-machine-learning-course\">machine learning course<\/a><\/strong> can provide you with the structured learning needed to master techniques like lasso regression and many others. So, let\u2019s dive in and connect these dots to see why each method is crucial and why continuing this learning journey through our blog is invaluable.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"introduction-to-lasso-regression\"><strong>Introduction to LASSO Regression<\/strong><\/h2>\n\n\n\n<p>LASSO regression, also known as L1 regularization, is a popular technique used in statistical modeling and machine learning to estimate the relationships between variables and make predictions. LASSO stands for Least Absolute Shrinkage and Selection Operator.<\/p>\n\n\n\n<p>The primary goal of LASSO regression is to find a balance between model simplicity and accuracy. It achieves this by adding a penalty term to the traditional<a href=\"https:\/\/www.mygreatlearning.com\/blog\/linear-regression-in-machine-learning\/\" target=\"_blank\" rel=\"noreferrer noopener\"> linear regression <\/a>model, which encourages sparse solutions where some coefficients are forced to be exactly zero. <\/p>\n\n\n\n<p>This feature makes LASSO particularly useful for feature selection, as it can automatically identify and discard irrelevant or redundant variables.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-lasso-regression\"><strong>What is Lasso Regression?<\/strong><\/h2>\n\n\n\n<p>Lasso regression is a regularization technique. It is used over regression methods for a more accurate prediction. This model uses shrinkage. Shrinkage is where data values are shrunk towards a central point as the mean. <\/p>\n\n\n\n<p>The lasso procedure encourages simple, sparse models (i.e. models with fewer parameters). This particular type of regression is well-suited for models showing high levels of multicollinearity or when you want to automate certain parts of model selection, like variable selection\/parameter elimination.<\/p>\n\n\n\n<p>Lasso Regression uses L1 regularization technique (will be discussed later in this article). It is used when we have more features because it automatically performs feature selection.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-by-step-explanation-of-how-lasso-regression-works\"><strong>Step By Step Explanation Of How LASSO Regression Works<\/strong>?<\/h3>\n\n\n\n<p>This indicates the root mean squared error of the Lasso Regression model on predicting house prices in the test set.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Linear Regression Model<\/strong><br>LASSO regression starts with the standard linear regression model, which assumes a linear relationship between the independent variables (features) and the dependent variable (target). The linear regression equation can be represented as follows:<br><strong>= \u03b2\u2080 + \u03b2\u2081x\u2081 + \u03b2\u2082x\u2082 + ... + \u03b2\u209ax\u209a + \u03b5<\/strong><\/li>\n<\/ol>\n\n\n\n<p>&nbsp;Where:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>y is the dependent variable (target).<\/li>\n\n\n\n<li>\u03b2\u2080, \u03b2\u2081, \u03b2\u2082, ..., \u03b2\u209a are the coefficients (parameters) to be estimated.<\/li>\n\n\n\n<li>x\u2081, x\u2082, ..., x\u209a are the independent variables (features).<\/li>\n\n\n\n<li>\u03b5 represents the error term.<\/li>\n<\/ul>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>L1 Regularization<\/strong><strong><br><\/strong>LASSO regression introduces an additional penalty term based on the absolute values of the coefficients. The L1 regularization term is the sum of the absolute values of the coefficients multiplied by a tuning parameter \u03bb:<br><br><strong>L\u2081 = \u03bb * (|\u03b2\u2081| + |\u03b2\u2082| + ... + |\u03b2\u209a|)<\/strong><br><br>Where:\n<ul class=\"wp-block-list\">\n<li>\u03bb is the regularization parameter that controls the amount of regularization applied.<\/li>\n\n\n\n<li>\u03b2\u2081, \u03b2\u2082, ..., \u03b2\u209a are the coefficients.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>Objective Function<br><\/strong>The objective of LASSO regression is to find the values of the coefficients that minimize the sum of the squared differences between the predicted values and the actual values, while also minimizing the L1 regularization term:<br><br><strong>RSS + L\u2081&nbsp;<\/strong><br><br>Where:<br>RSS is the residual sum of squares, which measures the error between the predicted values and the actual values.<\/li>\n<\/ol>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li><strong>Shrinking Coefficients<\/strong><br>By adding the L1 regularization term, LASSO regression can shrink the coefficients towards zero. When \u03bb is sufficiently large, some coefficients are driven to exactly zero.&nbsp;<br><br>This property of LASSO makes it useful for feature selection, as the variables with zero coefficients are effectively removed from the model.<\/li>\n<\/ol>\n\n\n\n<ol start=\"5\" class=\"wp-block-list\">\n<li><strong>Tuning parameter \u03bb<\/strong><br>The choice of the regularization parameter <strong>\u03bb <\/strong>is crucial in LASSO regression. A larger \u03bb value increases the amount of regularization, leading to more coefficients being pushed towards zero.<br><br>Conversely, a smaller \u03bb value reduces the regularization effect, allowing more variables to have non-zero coefficients.<\/li>\n<\/ol>\n\n\n\n<ol start=\"6\" class=\"wp-block-list\">\n<li><strong>Model Fitting<\/strong><br>To estimate the coefficients in LASSO regression, an optimization algorithm is used to minimize the objective function. Coordinate Descent is commonly employed, which iteratively updates each coefficient while holding the others fixed.<\/li>\n<\/ol>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<p>LASSO regression offers a powerful framework for both prediction and feature selection, especially when dealing with high-dimensional datasets where the number of features is large. <br><br>By striking a balance between simplicity and accuracy, LASSO can provide interpretable models while effectively managing the risk of overfitting.<\/p>\n\n\n\n<p>It's worth noting that LASSO is just one type of regularization technique, and there are other variants such as Ridge regression (L2 regularization) and Elastic Net<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"lasso-meaning\"><strong>Lasso Meaning<\/strong><\/h3>\n\n\n\n<p>The word <strong>\u201cLASSO\u201d stands for Least Absolute Shrinkage and Selection Operator<\/strong>. It is a statistical formula for the regularisation of data models and feature selection.  <\/p>\n\n\n\n    <div class=\"courses-cta-container\">\n        <div class=\"courses-cta-card\">\n            <div class=\"courses-cta-header\">\n                <div class=\"courses-learn-icon\"><\/div>\n                <span class=\"courses-learn-text\">Advance Data Science with MIT<\/span>\n            <\/div>\n            <p class=\"courses-cta-title\">\n                <a href=\"https:\/\/idss-gl.mit.edu\/mit-idss-data-science-machine-learning-online-program\" class=\"courses-cta-title-link\">MIT Data Science and Machine Learning Course<\/a>\n            <\/p>\n            <p class=\"courses-cta-description\">Unlock the power of data. Build hands-on data science and machine learning skills to drive innovation in your career.<\/p>\n            <div class=\"courses-cta-stats\">\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-user-icon\"><\/div>\n                    <span>Duration: 12 weeks<\/span>\n                <\/div>\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-star-icon\"><\/div>\n                    <span>4.62\/5 Rating<\/span>\n                <\/div>\n            <\/div>\n            <a href=\"https:\/\/idss-gl.mit.edu\/mit-idss-data-science-machine-learning-online-program\" class=\"courses-cta-button\">\n                Discover the Program\n                <div class=\"courses-arrow-icon\"><\/div>\n            <\/a>\n        <\/div>\n    <\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"regularization\"><strong>Regularization<\/strong><\/h2>\n\n\n\n<p>Regularization is an important concept that is used to avoid overfitting of the data, especially when the trained and test data are much varying.<\/p>\n\n\n\n<p>Regularization is implemented by adding a \u201cpenalty\u201d term to the best fit derived from the trained data, to achieve a <em>lesser variance<\/em> with the tested data and also restricts the influence of predictor variables over the output variable by compressing their coefficients.<\/p>\n\n\n\n<p>In regularization, what we do is normally we keep the same number of features but reduce the magnitude of the coefficients. We can reduce the magnitude of the coefficients by using different types of regression techniques which uses regularization to overcome this problem. So, let us discuss them.<\/p>\n\n\n\n<p><em>Also Read: <a aria-label=\"Python Tutorial for Beginners  (opens in a new tab)\" href=\"https:\/\/www.mygreatlearning.com\/blog\/python-tutorial-for-beginners-a-complete-guide\/\" target=\"_blank\" rel=\"noreferrer noopener\">Python Tutorial for Beginners <\/a><\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"lasso-regularization-techniques\"><strong>Lasso Regularization Techniques<\/strong><\/h2>\n\n\n\n<p>There are two main regularization techniques, namely Ridge Regression and Lasso Regression. They both differ in the way they assign a penalty to the coefficients. In this blog, we will try to understand more about Lasso Regularization technique.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"l1-regularization\"><strong>L1 Regularization<\/strong><\/h2>\n\n\n\n<p>If a regression model uses the L1 Regularization technique, then it is called Lasso Regression. If it used the L2 regularization technique, it's called Ridge Regression. We will study more about these in the later sections. <\/p>\n\n\n\n<p>L1 regularization adds a penalty that is equal to the<a href=\"https:\/\/www.statisticshowto.com\/integer\/#abs\">&nbsp;<\/a>absolute value of the magnitude of the coefficient. This regularization type can result in sparse models with few coefficients. Some coefficients might become zero and get eliminated from the model. <br><br>Larger penalties result in coefficient values that are closer to zero (ideal for producing simpler models). On the other hand, L2 regularization does not result in any elimination of sparse models or coefficients. Thus, Lasso Regression is easier to interpret as compared to the Ridge. <\/p>\n\n\n\n<p>While there are ample resources available online to help you understand the subject but getting certified for it is something beyond ordinary. <br><br>Check out Great Learning's<a href=\"https:\/\/www.mygreatlearning.com\/pg-program-artificial-intelligence-course\"> best artificial intelligence course online<\/a> to upskill in the domain. This course will help you learn from a top-ranking global school to build job-ready AIML skills. This 12-month program offers a hands-on learning experience with top faculty and mentors. On completion, you will receive a Certificate from The University of Texas at Austin, and Great Lakes Executive Learning. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"mathematical-equation-of-lasso-regression\"><strong>Mathematical equation of Lasso Regression<\/strong><\/h2>\n\n\n\n<p><strong>Residual Sum of Squares + \u03bb * (Sum of the absolute value of the magnitude of coefficients)<\/strong><\/p>\n\n\n\n<p>Where, <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u03bb denotes the amount of shrinkage.<\/li>\n\n\n\n<li>\u03bb = 0 implies all features are considered and it is equivalent to the linear regression where only the residual sum of squares is considered to build a predictive model<\/li>\n\n\n\n<li>\u03bb = \u221e implies no feature is considered i.e, as \u03bb closes to infinity it eliminates more and more features<\/li>\n\n\n\n<li>The bias increases with increase in \u03bb<\/li>\n\n\n\n<li>variance increases with decrease in \u03bb<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"lasso-regression-in-python\"><strong>Lasso Regression in Python<\/strong><\/h2>\n\n\n\n<p>For this example code, we will consider a dataset from Machine hack\u2019s&nbsp;<a href=\"https:\/\/www.machinehack.com\/course\/predicting-restaurant-food-cost-hackathon\/\" target=\"_blank\" rel=\"nofollow noreferrer noopener\" aria-label=\" (opens in a new tab)\">Predicting Restaurant Food Cost Hackathon<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"about-the-data-set\"><strong>About the Data Set<\/strong><\/h4>\n\n\n\n<p>The task here&nbsp;is about predicting the average price for a meal. The data consists of the following features.<\/p>\n\n\n\n<p>Size of training set: 12,690 records<\/p>\n\n\n\n<p>Size of test set: 4,231 records<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"columns-features\"><strong>Columns\/Features<\/strong><\/h4>\n\n\n\n<p><strong>TITLE<\/strong>: The feature of the restaurant which can help identify what and for whom it is suitable for.<\/p>\n\n\n\n<p><strong>RESTAURANT_ID<\/strong>: A unique ID for each restaurant.<\/p>\n\n\n\n<p><strong>CUISINES<\/strong>: The variety of cuisines that the restaurant offers.<\/p>\n\n\n\n<p><strong>TIME<\/strong>: The open hours of the restaurant.<\/p>\n\n\n\n<p><strong>CITY<\/strong>: The city in which the restaurant is located.<\/p>\n\n\n\n<p><strong>LOCALITY<\/strong>: The locality of the restaurant.<\/p>\n\n\n\n<p><strong>RATING<\/strong>: The average rating of the restaurant by customers.<\/p>\n\n\n\n<p><strong>VOTES<\/strong>: The overall votes received by the restaurant.<\/p>\n\n\n\n<p><strong>COST<\/strong>: The average cost of a two-person meal.<\/p>\n\n\n\n<p>After completing all the steps till Feature Scaling (Excluding), we can proceed to building a Lasso regression. We are avoiding feature scaling as the lasso regression comes with a parameter that allows us to normalise the data while fitting it to the model.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"lasso-regression-example\"><strong>Lasso regression example<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport numpy as np\n<\/pre><\/div>\n\n\n<p><strong>Creating a New Train and Validation Datasets<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom sklearn.model_selection import train_test_split\ndata_train, data_val = train_test_split(new_data_train, test_size = 0.2, random_state = 2)\n<\/pre><\/div>\n\n\n<p><strong>Classifying Predictors and Target<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n#Classifying Independent and Dependent Features\n#_______________________________________________\n#Dependent Variable\nY_train = data_train.iloc&#x5B;:, -1].values\n#Independent Variables\nX_train = data_train.iloc&#x5B;:,0 : -1].values\n#Independent Variables for Test Set\nX_test = data_val.iloc&#x5B;:,0 : -1].values\n<\/pre><\/div>\n\n\n<p><strong>Evaluating The Model With RMLSE<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef score(y_pred, y_true):\nerror = np.square(np.log10(y_pred +1) - np.log10(y_true +1)).mean() ** 0.5\nscore = 1 - error\nreturn score\nactual_cost = list(data_val&#x5B;&#039;COST&#039;])\nactual_cost = np.asarray(actual_cost)\n<\/pre><\/div>\n\n\n<p><strong>Building the Lasso Regressor<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n#Lasso Regression\n\n\nfrom sklearn.linear_model import Lasso\n#Initializing the Lasso Regressor with Normalization Factor as True\nlasso_reg = Lasso(normalize=True)\n#Fitting the Training data to the Lasso regressor\nlasso_reg.fit(X_train,Y_train)\n#Predicting for X_test\ny_pred_lass =lasso_reg.predict(X_test)\n#Printing the Score with RMLSE\nprint(&quot;nnLasso SCORE : &quot;, score(y_pred_lass, actual_cost))\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"output\"><strong>Output<\/strong><\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n0.7335508027883148\n<\/pre><\/div>\n\n\n<p><strong>The Lasso Regression attained an accuracy of 73% with the given Dataset.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"lasso-regression-in-r\"><strong>Lasso Regression in R<\/strong><\/h2>\n\n\n\n<p>We'll use the Boston Housing dataset, which is a classic dataset used for regression tasks. It includes information about various factors that might influence the median value of homes in different Boston neighborhoods.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"columns-features\"><strong>Columns\/Features:<\/strong><\/h3>\n\n\n\n<p><strong>crim: <\/strong>Per capita crime rate by town.<\/p>\n\n\n\n<p><strong>zn:<\/strong> Proportion of residential land zoned for lots over 25,000 sq. ft.<\/p>\n\n\n\n<p><strong>indus:<\/strong> Proportion of non-retail business acres per town.<\/p>\n\n\n\n<p><strong>chas: <\/strong>Charles River dummy variable (= 1 if tract bounds river; 0 otherwise).<\/p>\n\n\n\n<p><strong>nox: <\/strong>Nitrogen oxides concentration (parts per 10 million).<\/p>\n\n\n\n<p><strong>rm: <\/strong>Average number of rooms per dwelling.<\/p>\n\n\n\n<p><strong>age: <\/strong>Proportion of owner-occupied units built prior to 1940.<\/p>\n\n\n\n<p><strong>dis: <\/strong>Weighted distances to five Boston employment centers.<\/p>\n\n\n\n<p><strong>rad: <\/strong>Index of accessibility to radial highways.<\/p>\n\n\n\n<p><strong>tax:<\/strong> Full-value property tax rate per $10,000.<\/p>\n\n\n\n<p><strong>ptratio: <\/strong>Pupil-teacher ratio by town.<\/p>\n\n\n\n<p><strong>b:<\/strong> 1000(Bk - 0.63)^2 where Bk is the proportion of blacks by town.<\/p>\n\n\n\n<p><strong>lstat: <\/strong>Percentage lower status of the population.<\/p>\n\n\n\n<p><strong>medv: <\/strong>Median value of owner-occupied homes in $1000s (target variable).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"code-implementation\"><strong>Code Implementation<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: r; title: ; notranslate\" title=\"\">\n# Load necessary libraries\n\nlibrary(glmnet)\n\nlibrary(caret)\n\n# Load the Boston Housing dataset\n\ndata(Boston)\n\nhead(Boston)\n\n# Data preprocessing\n\nX &lt;- as.matrix(Boston&#x5B;, -14])\u00a0 # Features\n\nY &lt;- Boston$medv\u00a0 # Target variable\n\n# Splitting data into training and test sets\n\nset.seed(123)\n\ntrain_index &lt;- createDataPartition(Y, p = 0.8, list = FALSE)\n\ntrain_data &lt;- X&#x5B;train_index, ]\n\ntest_data &lt;- X&#x5B;-train_index, ]\n\ntrain_label &lt;- Y&#x5B;train_index]\n\ntest_label &lt;- Y&#x5B;-train_index]\n\n# Building Lasso Regression model\n\nlasso_model &lt;- glmnet(train_data, train_label, alpha = 1)\n\n# Predicting on test set\n\npredictions &lt;- predict(lasso_model, newx = test_data, s = 0.01)\n\n# Evaluating the model (using Root Mean Squared Error as an example)\n\nrmse &lt;- sqrt(mean((predictions - test_label)^2))\n\n# Printing the results\n\ncat(&quot;Lasso Regression RMSE:&quot;, rmse, &quot;\\n&quot;)\n\n# Plotting coefficients\n\nplot(lasso_model, xvar = &quot;lambda&quot;, main = &quot;Lasso Coefficients Path&quot;)\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"explanation\"><strong>Explanation<\/strong><\/h3>\n\n\n\n<p><strong>1. Loading Libraries and Dataset:<br><\/strong>We load the necessary libraries glmnet for Lasso Regression and caret for data partitioning.<br>The Boston Housing dataset is loaded using data(Boston).<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<p><strong>2. Data Preprocessing:<br><\/strong>We convert the dataset into matrices (X for features excluding the target variable medv, and Y for the target variable).<\/p>\n\n\n\n<p><strong>3. Splitting Data:<br><\/strong>We split the data into training and test sets using createDataPartition from caret, keeping 80% for training.<\/p>\n\n\n\n<p><strong>4. Building Lasso Regression Model:<br><\/strong>We create a Lasso Regression model using glmnet with alpha = 1 (to enforce Lasso regularization).<\/p>\n\n\n\n<p><strong>5. Predicting on Test Set:<br><\/strong>We make predictions on the test set using the trained Lasso model.<\/p>\n\n\n\n<p><strong>6. Evaluating the Model:<br><\/strong>We evaluate the model's performance using Root Mean Squared Error (RMSE) between predicted and actual house prices.<\/p>\n\n\n\n<p><strong>7. Output:<br><\/strong>The RMSE value is printed as a measure of model accuracy.<\/p>\n\n\n\n<p><strong>8. Visualizing Coefficients:<br><\/strong>Lastly, we plot the Lasso coefficient path over different values of lambda (regularization parameter), which helps in understanding which features are important in predicting house prices.<\/p>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: r; title: ; notranslate\" title=\"\">\nLasso Regression RMSE: 4.61534\n<\/pre><\/div>\n\n\n<p>This indicates the root mean squared error of the Lasso Regression model on predicting house prices in the test set.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"difference-between-ridge-regression-and-lasso-regression\"><strong>Difference Between Ridge Regression and Lasso Regression<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>Ridge Regression<\/th><th>Lasso Regression<\/th><\/tr><\/thead><tbody><tr><td>The penalty term is the sum of the squares of the coefficients (L2 regularization).<\/td><td>The penalty term is the sum of the absolute values of the coefficients (L1 regularization).<\/td><\/tr><tr><td>Shrinks the coefficients but doesn\u2019t set any coefficient to zero.<\/td><td>Can shrink some coefficients to zero, effectively performing feature selection.<\/td><\/tr><tr><td>Helps to reduce overfitting by shrinking large coefficients.<\/td><td>Helps to reduce overfitting by shrinking and selecting features with less importance.<\/td><\/tr><tr><td>Works well when there are a large number of features.<\/td><td>Works well when there are a small number of features.<\/td><\/tr><tr><td>Performs \"soft thresholding\" of coefficients.<\/td><td>Performs \"hard thresholding\" of coefficients.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>In short, Ridge is a shrinkage model, and Lasso is a feature selection model. Ridge tries to balance the bias-variance trade-off by shrinking the coefficients, but it does not select any feature and keeps all of them. Lasso tries to balance the bias-variance trade-off by shrinking some coefficients to zero. <br><br>In this way, Lasso can be seen as an optimizer for feature selection.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"interpretations-and-generalizations\"><strong>Interpretations and Generalizations<\/strong><\/h2>\n\n\n\n<p><strong>Interpretations<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Geometric Interpretations<\/li>\n\n\n\n<li>Bayesian Interpretations<\/li>\n\n\n\n<li>Convex relaxation Interpretations<\/li>\n\n\n\n<li>Making \u03bb easier to interpret with an accuracy-simplicity tradeoff<\/li>\n<\/ol>\n\n\n\n<p><strong>Generalizations<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Elastic Net<\/li>\n\n\n\n<li>Group Lasso<\/li>\n\n\n\n<li>Fused Lasso<\/li>\n\n\n\n<li>Adaptive Lasso<\/li>\n\n\n\n<li>Prior Lasso<\/li>\n\n\n\n<li>Quasi-norms and bridge regression<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"linear-regression-vs-logistic-regression-video\"><strong>Linear Regression vs Logistic Regression Video<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Linear Regression vs Logistic Regression | Learn Data Science | Great learning\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/zrzXN_gib3A?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"conclusion\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p><br>LASSO regression emerges as a crucial technique for statistical modeling and machine learning, striking a balance between model simplicity and accuracy.<\/p>\n\n\n\n<p>With its ability to promote sparsity through feature selection, LASSO regression aids in identifying relevant variables and managing overfitting, particularly in high-dimensional datasets. To deepen your understanding and enhance your skills, explore <strong><a href=\"https:\/\/www.mygreatlearning.com\/academy\" target=\"_blank\" rel=\"noreferrer noopener\">free certification courses<\/a><\/strong> on statistical modeling and machine learning techniques.<br>To deepen your understanding of LASSO and other essential skills, explore Great Learning's <a href=\"https:\/\/www.mygreatlearning.com\/python\/free-courses\">free Python courses<\/a>, providing flexible learning options and opportunities to enhance your expertise. <br><br>For those aspiring to secure lucrative careers in the field of artificial intelligence and machine learning, the PG Program in <a href=\"https:\/\/www.mygreatlearning.com\/great-lakes-artificial-intelligence-and-machine-learning?&amp;utm_source=Search&amp;utm_medium=brand-ex-greatlakes&amp;utm_campaign=aiml-del-hi-brand-multi-open&amp;adgroup_id=80785993431&amp;campaign_id=6497057433&amp;keyword=great%20lakes%20artificial%20intelligence&amp;ad_id=612956854023&amp;gad_source=1&amp;gclid=CjwKCAjwl4yyBhAgEiwADSEjeFrQOnemInYGI_vfU3WELuga2MjHOaWO8XYtEIlkuD2B6AHM_6mfkxoC9ycQAvD_BwE\">Artificial Intelligence &amp; Machine Learning<\/a> offers comprehensive training, weekly online mentorship by experts, project assistance, and networking opportunities, helping you to develop a robust skill set and advance your career prospects<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"faqs-related-to-lasso-regression\"><strong>FAQs Related to Lasso Regression<\/strong><\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1673497948871\"><strong class=\"schema-faq-question\"><strong>What is Lasso regression used for?<\/strong><\/strong> <p class=\"schema-faq-answer\">Lasso regression is used for eliminating automated variables and the selection of features.\u00a0<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1673497965834\"><strong class=\"schema-faq-question\"><strong>What is lasso and ridge regression?<\/strong><\/strong> <p class=\"schema-faq-answer\">Lasso regression makes coefficients to absolute zero; while ridge regression is a model turning method that is used for analyzing data suffering from multicollinearity<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1673497974861\"><strong class=\"schema-faq-question\"><strong>What is Lasso Regression in machine learning?<\/strong><\/strong> <p class=\"schema-faq-answer\">Lasso regression makes coefficients to absolute zero; while ridge regression is a model turning method that is used for analyzing data suffering from multicollinearity<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1673497989237\"><strong class=\"schema-faq-question\"><strong>Why does Lasso shrink zero?<\/strong><\/strong> <p class=\"schema-faq-answer\"> The L1 regularization performed by Lasso, causes the regression coefficient of the less contributing variable to shrink to zero or near zero.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1673498005525\"><strong class=\"schema-faq-question\"><strong>Is lasso better than Ridge?<\/strong><\/strong> <p class=\"schema-faq-answer\">Lasso is considered to be better than ridge as it selects only some features and decreases the coefficients of others to zero.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1673498025642\"><strong class=\"schema-faq-question\"><strong>How does Lasso regression work?<\/strong><\/strong> <p class=\"schema-faq-answer\">Lasso regression uses shrinkage, where the data values are shrunk towards a central point such as the mean value.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1673498035031\"><strong class=\"schema-faq-question\"><strong>What is the Lasso penalty?<\/strong><\/strong> <p class=\"schema-faq-answer\">The Lasso penalty shrinks or reduces the coefficient value towards zero. The less contributing variable is therefore allowed to have a zero or near-zero coefficient.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1673498045469\"><strong class=\"schema-faq-question\"><strong>Is lasso L1 or L2?<\/strong><\/strong> <p class=\"schema-faq-answer\">A regression model using the L1 regularization technique is called Lasso Regression, while a model using L2 is called Ridge Regression. The difference between these two is the term penalty.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1673498058212\"><strong class=\"schema-faq-question\"><strong>Is lasso supervised or unsupervised?<\/strong><\/strong> <p class=\"schema-faq-answer\">Lasso is a supervised regularization method used in machine learning.<\/p> <\/div> <\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Contributed by: Dinesh Kumar We hope you've had a chance to go through our previous articles on regression and ridge regression. Building on that foundation, it's now time to explore lasso regression. Like its predecessors, lasso regression is a powerful tool for predictive modeling, but it comes with its unique twist\u2014penalizing the absolute size of [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":20023,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[2],"tags":[36799],"content_type":[36248],"class_list":["post-20019","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-artificial-intelligence","tag-machine-learning","content_type-career-guide"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>What is LASSO Regression Definition, Examples and Techniques<\/title>\n<meta name=\"description\" content=\"Lasso Regression: \u201cLASSO\u201d stands for Least Absolute Shrinkage and Selection Operator. Lasso regression is a regularization technique.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Complete understanding of LASSO Regression\" \/>\n<meta property=\"og:description\" content=\"Lasso Regression: \u201cLASSO\u201d stands for Least Absolute Shrinkage and Selection Operator. Lasso regression is a regularization technique.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-10T06:46:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-14T18:41:09+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/iStock-926051128.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1241\" \/>\n\t<meta property=\"og:image:height\" content=\"844\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Great Learning Editorial Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/Great_Learning\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Great Learning Editorial Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"A Complete understanding of LASSO Regression\",\"datePublished\":\"2024-04-10T06:46:00+00:00\",\"dateModified\":\"2024-10-14T18:41:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/\"},\"wordCount\":2441,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/iStock-926051128.jpg\",\"keywords\":[\"Machine Learning\"],\"articleSection\":[\"AI and Machine Learning\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#respond\"]}]},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/\",\"name\":\"What is LASSO Regression Definition, Examples and Techniques\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/iStock-926051128.jpg\",\"datePublished\":\"2024-04-10T06:46:00+00:00\",\"dateModified\":\"2024-10-14T18:41:09+00:00\",\"description\":\"Lasso Regression: \u201cLASSO\u201d stands for Least Absolute Shrinkage and Selection Operator. Lasso regression is a regularization technique.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673497948871\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673497965834\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673497974861\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673497989237\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673498005525\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673498025642\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673498035031\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673498045469\"},{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673498058212\"}],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/iStock-926051128.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/iStock-926051128.jpg\",\"width\":1241,\"height\":844,\"caption\":\"lasso regression\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AI and Machine Learning\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/artificial-intelligence\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"A Complete understanding of LASSO Regression\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GreatLearningOfficial\\\/\",\"https:\\\/\\\/x.com\\\/Great_Learning\",\"https:\\\/\\\/www.instagram.com\\\/greatlearningofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/greatlearning12\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/beaconelearning\\\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/Great_Learning\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\\\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/author\\\/greatlearning\\\/\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673497948871\",\"position\":1,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673497948871\",\"name\":\"u003cstrongu003eWhat is Lasso regression used for?u003c\\\/strongu003e\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Lasso regression is used for eliminating automated variables and the selection of features.\u00a0\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673497965834\",\"position\":2,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673497965834\",\"name\":\"u003cstrongu003eWhat is lasso and ridge regression?u003c\\\/strongu003e\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Lasso regression makes coefficients to absolute zero; while ridge regression is a model turning method that is used for analyzing data suffering from multicollinearity\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673497974861\",\"position\":3,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673497974861\",\"name\":\"u003cstrongu003eWhat is Lasso Regression in machine learning?u003c\\\/strongu003e\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Lasso regression makes coefficients to absolute zero; while ridge regression is a model turning method that is used for analyzing data suffering from multicollinearity\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673497989237\",\"position\":4,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673497989237\",\"name\":\"u003cstrongu003eWhy does Lasso shrink zero?u003c\\\/strongu003e\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\" The L1 regularization performed by Lasso, causes the regression coefficient of the less contributing variable to shrink to zero or near zero.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673498005525\",\"position\":5,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673498005525\",\"name\":\"u003cstrongu003eIs lasso better than Ridge?u003c\\\/strongu003e\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Lasso is considered to be better than ridge as it selects only some features and decreases the coefficients of others to zero.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673498025642\",\"position\":6,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673498025642\",\"name\":\"u003cstrongu003eHow does Lasso regression work?u003c\\\/strongu003e\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Lasso regression uses shrinkage, where the data values are shrunk towards a central point such as the mean value.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673498035031\",\"position\":7,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673498035031\",\"name\":\"u003cstrongu003eWhat is the Lasso penalty?u003c\\\/strongu003e\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"The Lasso penalty shrinks or reduces the coefficient value towards zero. The less contributing variable is therefore allowed to have a zero or near-zero coefficient.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673498045469\",\"position\":8,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673498045469\",\"name\":\"u003cstrongu003eIs lasso L1 or L2?u003c\\\/strongu003e\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"A regression model using the L1 regularization technique is called Lasso Regression, while a model using L2 is called Ridge Regression. The difference between these two is the term penalty.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673498058212\",\"position\":9,\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/understanding-of-lasso-regression\\\/#faq-question-1673498058212\",\"name\":\"u003cstrongu003eIs lasso supervised or unsupervised?u003c\\\/strongu003e\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Lasso is a supervised regularization method used in machine learning.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"What is LASSO Regression Definition, Examples and Techniques","description":"Lasso Regression: \u201cLASSO\u201d stands for Least Absolute Shrinkage and Selection Operator. Lasso regression is a regularization technique.","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:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/","og_locale":"en_US","og_type":"article","og_title":"A Complete understanding of LASSO Regression","og_description":"Lasso Regression: \u201cLASSO\u201d stands for Least Absolute Shrinkage and Selection Operator. Lasso regression is a regularization technique.","og_url":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","article_published_time":"2024-04-10T06:46:00+00:00","article_modified_time":"2024-10-14T18:41:09+00:00","og_image":[{"width":1241,"height":844,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/iStock-926051128.jpg","type":"image\/jpeg"}],"author":"Great Learning Editorial Team","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/Great_Learning","twitter_site":"@Great_Learning","twitter_misc":{"Written by":"Great Learning Editorial Team","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"A Complete understanding of LASSO Regression","datePublished":"2024-04-10T06:46:00+00:00","dateModified":"2024-10-14T18:41:09+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/"},"wordCount":2441,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/iStock-926051128.jpg","keywords":["Machine Learning"],"articleSection":["AI and Machine Learning"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#respond"]}]},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/","url":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/","name":"What is LASSO Regression Definition, Examples and Techniques","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/iStock-926051128.jpg","datePublished":"2024-04-10T06:46:00+00:00","dateModified":"2024-10-14T18:41:09+00:00","description":"Lasso Regression: \u201cLASSO\u201d stands for Least Absolute Shrinkage and Selection Operator. Lasso regression is a regularization technique.","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673497948871"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673497965834"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673497974861"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673497989237"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673498005525"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673498025642"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673498035031"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673498045469"},{"@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673498058212"}],"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/iStock-926051128.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/iStock-926051128.jpg","width":1241,"height":844,"caption":"lasso regression"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"AI and Machine Learning","item":"https:\/\/www.mygreatlearning.com\/blog\/artificial-intelligence\/"},{"@type":"ListItem","position":3,"name":"A Complete understanding of LASSO Regression"}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673497948871","position":1,"url":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673497948871","name":"u003cstrongu003eWhat is Lasso regression used for?u003c\/strongu003e","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Lasso regression is used for eliminating automated variables and the selection of features.\u00a0","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673497965834","position":2,"url":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673497965834","name":"u003cstrongu003eWhat is lasso and ridge regression?u003c\/strongu003e","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Lasso regression makes coefficients to absolute zero; while ridge regression is a model turning method that is used for analyzing data suffering from multicollinearity","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673497974861","position":3,"url":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673497974861","name":"u003cstrongu003eWhat is Lasso Regression in machine learning?u003c\/strongu003e","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Lasso regression makes coefficients to absolute zero; while ridge regression is a model turning method that is used for analyzing data suffering from multicollinearity","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673497989237","position":4,"url":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673497989237","name":"u003cstrongu003eWhy does Lasso shrink zero?u003c\/strongu003e","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":" The L1 regularization performed by Lasso, causes the regression coefficient of the less contributing variable to shrink to zero or near zero.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673498005525","position":5,"url":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673498005525","name":"u003cstrongu003eIs lasso better than Ridge?u003c\/strongu003e","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Lasso is considered to be better than ridge as it selects only some features and decreases the coefficients of others to zero.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673498025642","position":6,"url":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673498025642","name":"u003cstrongu003eHow does Lasso regression work?u003c\/strongu003e","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Lasso regression uses shrinkage, where the data values are shrunk towards a central point such as the mean value.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673498035031","position":7,"url":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673498035031","name":"u003cstrongu003eWhat is the Lasso penalty?u003c\/strongu003e","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"The Lasso penalty shrinks or reduces the coefficient value towards zero. The less contributing variable is therefore allowed to have a zero or near-zero coefficient.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673498045469","position":8,"url":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673498045469","name":"u003cstrongu003eIs lasso L1 or L2?u003c\/strongu003e","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"A regression model using the L1 regularization technique is called Lasso Regression, while a model using L2 is called Ridge Regression. The difference between these two is the term penalty.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673498058212","position":9,"url":"https:\/\/www.mygreatlearning.com\/blog\/understanding-of-lasso-regression\/#faq-question-1673498058212","name":"u003cstrongu003eIs lasso supervised or unsupervised?u003c\/strongu003e","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Lasso is a supervised regularization method used in machine learning.","inLanguage":"en-US"},"inLanguage":"en-US"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/iStock-926051128.jpg",1241,844,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/iStock-926051128-150x150.jpg",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/iStock-926051128-300x204.jpg",300,204,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/iStock-926051128-768x522.jpg",768,522,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/iStock-926051128-1024x696.jpg",1024,696,true],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/iStock-926051128.jpg",1241,844,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/iStock-926051128.jpg",1241,844,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/iStock-926051128.jpg",640,435,false],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/iStock-926051128.jpg",96,65,false],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/iStock-926051128.jpg",150,102,false]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":1,"uagb_excerpt":"Contributed by: Dinesh Kumar We hope you've had a chance to go through our previous articles on regression and ridge regression. Building on that foundation, it's now time to explore lasso regression. Like its predecessors, lasso regression is a powerful tool for predictive modeling, but it comes with its unique twist\u2014penalizing the absolute size of&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/20019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=20019"}],"version-history":[{"count":73,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/20019\/revisions"}],"predecessor-version":[{"id":110641,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/20019\/revisions\/110641"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/20023"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=20019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=20019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=20019"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=20019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}