For Lasso regression our cost function is
C(β)=p−1∑i=0(yi−βi)2+λp−1∑i=0|βi|=p−1∑i=0(yi−βi)2+λp−1∑i=0√β2i,and minimizing we have that
−2p−1∑i=0(yi−βi)+λp−1∑i=0(βi)|βi|=0,which leads to
ˆβLassoi={yi−λ2ifyi>λ2yi+λ2ifyi<−λ20if|yi|≤λ2.Plotting these results shows clearly that Lasso regression suppresses (sets to zero) values of βi for specific values of λ. Ridge regression reduces on the other hand the values of βi as function of λ.