Skip to content

Commit d185c61

Browse files
committed
BUG Use correct alphas in plot
1 parent b001ea3 commit d185c61

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ch07/lasso_path_plot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616

1717
las = Lasso(normalize=1)
1818
alphas = np.logspace(-5, 2, 1000)
19-
_, coefs, _= las.path(x, y, alphas=alphas)
19+
alphas, coefs, _= las.path(x, y, alphas=alphas)
2020

2121
fig,ax = plt.subplots()
2222
ax.plot(alphas, coefs.T)
2323
ax.set_xscale('log')
2424
ax.set_xlim(alphas.max(), alphas.min())
25+
ax.set_xlabel('Lasso coefficient path as a function of alpha')
2526
ax.set_xlabel('Alpha')
2627
ax.set_ylabel('Coefficient weight')
2728
fig.savefig('Figure_LassoPath.png', dpi=150)

0 commit comments

Comments
 (0)