dswah / pyGAM

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

Why confidence band intersect? #239

Closed tmp-coder closed 5 years ago

tmp-coder commented 5 years ago

hi, pyGAM team! @dswah thanks to your nice tool.

i train a data set and plot figs of every feature with confidence interval, but i got some interesting result. the confidence band intersect .

see figs:

confuse and code is here

j = 0
for i, term in enumerate(gam.terms):
    if term.isintercept:
        continue

    XX = gam.generate_X_grid(term=i)
    pdep, confi = gam.partial_dependence(term=i, X=XX, width=0.95)
    plt.subplot(r,c,i+1)
    plt.plot(XX[:, term.feature], pdep)
    plt.plot(XX[:, term.feature], confi, c='r', ls='--')
    plt.title(headers[j])
    j+=1

so i'd like to know if there are some bugs in the code or some other statistical analysis ?

thanks again!

tmp-coder commented 5 years ago

sorry to waste your time, i got the answer