Consider two scenarios, where the value of certain element in my weight matrix (matrix of parameters) undergo the following changes:
scenario 1: 1000 ---> 999 [the value reduces from 1000 to 999]
scenario 2: 1.1 ---> 0 [the value reduces from 1.1 to 0]
Now you could inspect for the L1 (Lasso) and L2 (Ridge) regularization, which change in weight value led to a greater reduction in the loss function.
Assume that the common loss term attributed to the data has a constant value and the only value affecting the total loss is the regularization term.
For L1 regularization, since the regularization term is $|w_{i}|$, the change in error for:
- scenario 1 : $|1000|-|999| = 1 $
- scenario 2 : $|1.1|-|0| = 1.1$
Since scenario 2 leads to a higher reduction in total Loss, the Lasso regression tries to execute scenario 2
For L2 regularization, since the regularization term is $|w_{i}|^{2}$, the change in error for:
- scenario 1 : $|1000|^{2}-|999|^{2} = 1999$
- scenario 2 : $|1.1|^{2}-|0|^{2} = 1.21$
Since scenario 1 leads to a higher reduction in total Loss, the Ridge regression tries to execute scenario 1.
Now I hope you understand why Lasso drives parameters to zero. This why its called the sparsity constraint :)