def cake_data_in_one(): X, y = cake() gam = LinearGAM(fit_intercept=True) gam.gridsearch(X, y) XX = gam.generate_X_grid() plt.figure() plt.plot(gam.partial_dependence(XX)) plt.title('LinearGAM') plt.savefig('imgs/pygam_cake_data.png', dpi=300)
def cake_X_y(): # y is real # recommend LinearGAM return cake(return_X_y=True)