dswah / pyGAM

[HELP REQUESTED] Generalized Additive Models in Python
https://pygam.readthedocs.io
Apache License 2.0
857 stars 157 forks source link

LogisticGAM sample() function fails due to shape mismatch #257

Open daniel-s-cunha opened 4 years ago

daniel-s-cunha commented 4 years ago
>>> samples = gam1.sample(X, y, quantity='mu',n_draws=1000, n_bootstraps=5, objective='auto')
100% (11 of 11) |##################################################################################################################################################| Elapsed Time: 0:00:01 Time:  0:00:01
100% (11 of 11) |##################################################################################################################################################| Elapsed Time: 0:00:01 Time:  0:00:01
100% (11 of 11) |##################################################################################################################################################| Elapsed Time: 0:00:01 Time:  0:00:01
100% (11 of 11) |##################################################################################################################################################| Elapsed Time: 0:00:01 Time:  0:00:01

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/anaconda3/lib/python3.6/site-packages/pygam/pygam.py", line 2030, in sample
    n_bootstraps=n_bootstraps, objective=objective)
  File "/anaconda3/lib/python3.6/site-packages/pygam/pygam.py", line 2108, in _sample_coef
    n_draws, coef_bootstraps, cov_bootstraps)
  File "/anaconda3/lib/python3.6/site-packages/pygam/pygam.py", line 2189, in _simulate_coef_from_bootstraps
    size=len(draw_indices))
ValueError: shape mismatch: value array of shape (204,51) could not be broadcast to indexing result of shape (204,52)