File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 22
22
squared loss function and the coefficients tend to zero.
23
23
At the end of the path, as alpha tends toward zero
24
24
and the solution tends towards the ordinary least squares, coefficients
25
- exhibit big oscillations. In practise it is necessary to tune alpha
25
+ exhibit big oscillations. In practice it is necessary to tune alpha
26
26
in such a way that a balance is maintained between both.
27
27
28
28
"""
63
63
ax .set_xlim (ax .get_xlim ()[::- 1 ]) # reverse axis
64
64
plt .xlabel ("alpha" )
65
65
plt .ylabel ("weights" )
66
- plt .title ("Ridge coefficients as a function of the regularization " )
66
+ plt .title ("Ridge Coefficients vs Regularization Strength (alpha) " )
67
67
plt .axis ("tight" )
68
+ plt .legend (
69
+ [f"Feature { i + 1 } " for i in range (X .shape [1 ])], loc = "best" , fontsize = "small"
70
+ )
68
71
plt .show ()
You can’t perform that action at this time.
0 commit comments