1

I need to copy this plot using pygam library. enter image description here I create GAM using the following code:

gam = LinearGAM(s(0, n_splines=5, spline_order=4) + s(1, n_splines=9) + f(2))
gam = gam.gridsearch(X, y, lam = lams)

Unfortunately, in my case the plots are the following: enter image description here The issue that I cannot manage to make the polygonal line in the left graph.
Note
This two graphs should be natural splines.

Bruh
  • 25
  • 7

0 Answers0