code: def chicago_tensor():
      
      X, y = chicago()
      gam = PoissonGAM(s(0, n_splines=200) + te(3, 1) + s(2)).fit(X, y)
  
      XX = gam.generate_X_grid(term=1, meshgrid=True)
      Z = gam.partial_dependence(term=1, meshgrid=True)
  
      fig = plt.figure()
      ax = plt.axes(projection='3d')
      ax.plot_surface(XX[0], XX[1], Z, cmap='viridis')
      fig.tight_layout()
  
      plt.savefig('imgs/pygam_chicago_tensor.png', dpi=300)
docs: chicago tensor