code: def gen_multi_data(n=5000):
      
      X, y = toy_classification(return_X_y=True, n=10000)
  
      lgam = LogisticGAM(s(0) + s(1) + s(2) + s(3) + s(4) + f(5))
      lgam.fit(X, y)
  
      plt.figure()
      for i, term in enumerate(lgam.terms):
          if term.isintercept:
              continue
          plt.plot(lgam.partial_dependence(term=i))
  
      plt.savefig('imgs/pygam_multi_pdep.png', dpi=300)
  
      plt.figure()
      plt.plot(lgam.logs_['deviance'])
      plt.savefig('imgs/pygam_multi_deviance.png', dpi=300)
docs: multivariate Logistic problem