I'm using Lasso Regularization to avoid overfitting & multicollinearity between two features (X1 and X2), nowing that I have 14 independent features. I got some good results for some features, Lasso was able to reduce the coefficient to 0, but for other features the linear regression coefficient was less than Lasso (same thing for Ridge).
lr = LinearRegression()
lr.fit(X, Y)
lr_coeff = lr.coef_
lr_intercept = lr.intercept_
lasso = Lasso(alpha=10)
lasso.fit(X, Y)
lasso_coeff = lasso.coef_
lasso_intercept = lasso.intercept_
Result:
lr_coeff lr_intercept lasso_coeff lasso_intercept
0 0.968567 16.01858 0.000000 103.471224
1 1.743420 16.01858 1.730920 103.471224
2 5.221518 16.01858 3.931450 103.471224
3 4.769328 16.01858 3.186003 103.471224
4 6.341612 16.01858 4.265931 103.471224
5 2.272504 16.01858 1.277541 103.471224
6 3.104016 16.01858 1.648253 103.471224
7 1.418943 16.01858 0.667189 103.471224
8 1.144834 16.01858 0.000000 103.471224
9 0.138457 16.01858 0.000000 103.471224
10 1.272995 16.01858 0.693323 103.471224
11 0.188450 16.01858 0.503958 103.471224
12 -2.334245 16.01858 -0.167953 103.471224
13 -0.475823 16.01858 0.124608 103.471224
14 0.489548 16.01858 0.512034 103.471224
Sincerely,