Repository navigation
GAM from GSoC 2015 - #2744
GAM from GSoC 2015#2744DonBeo wants to merge 7 commits into
Conversation
|
@DonBeo amend the commit and remove the statespace pyx file and force push about GAMGLMResults my guess Otherwise, looks good AFAICS, TravisCI is working and we should get results after 11 to 20 minutes. Thanks |
|
|
|
based on TravisCI test problems: the csv files are not included in the distribution package. |
|
the csv files are included for all |
|
I think all the previous problems are solved. I think this is something we can solve later |
There was a problem hiding this comment.
I think this should be self.cov_params instead of self.normalized_cov_params b/c of the missing scale for gaussian for example
|
you didn't fix, amend or rebase the first commit, so the pyx file is part of the history here. about the partial predict se: From a brief looks, I think the scale is missing. In Binomial and Poisson the scale is fixed at 1, but for Gaussian the scale is based on the residual errors like in OLS. In general |
|
It's starting to look good, The first python version is green on Travis. So there are only some compatibility problems matplotlib use is optional and needs to be protected, see for example test_mice.py which was also fixed, tests need skipif, importing matplotlib needs try except protection, and we also have some helper functions for it The problem on two other python versions that I checked is that we also use older |
|
According to https://github.com/pydata/patsy/commits/master/patsy/splines.py bsplines are part of patsy from 2013. Patsy seems to be almost a standalone library. It requires only I assume that we can update the patsy requirements without side effects.
|
|
in one of the travis there is an error related to the use of I do not have a python 2 environment. According to http://python-future.org/overview.html Is it the correct way to do it in statsmodels? |
|
patsy: travisci uses patsy 0.2 for some python, 0.2 is too old for a package that should be updated with statsmodels. super just needs the arguments What's the problem with |
There was a problem hiding this comment.
this super is missing the arguments like the other ones super(BSplines, self)
|
Even with |
|
Do you have unit tests for cov_params or bse itself to know whether those are correct? With no or little penalization and not a large number of knots cov_params and bse should be the same as or close to the standard GLM results. |
There was a problem hiding this comment.
this is inefficient calculation. It calculates (nobs, nobs) and takes only the diagonal.
in getprediction I use this (which I'm too tired to understand)
(exog * np.dot(covb, exog.T).T).sum(1)
where
exog = smoother.basis_[:, mask]
covb = partial_cov_params
|
apparently |
|
Hey guys, has there been any progress in merging this PR? |
|
Unfortunately during this period I did not have time to work on it. I have the impression that the first penalized linear model should be merged. |
|
Ok so maybe I will clone from master and merge it locally. I just wanted to play around with GAMs and see if they are useful for a project of mine. |
|
It's probably the easiest solution if you need it now. A part from |
|
So I had a quick look at the code today, and while I think it has a few edge cases and bugs, it should probably be merged if it passes the tests. Since GAM is really something Python needs. Is this the most up to date version? |
|
Ok I'll see if I can pull these files into another PR and see if I can get that working, next week or the week after. |
|
I think this code has still some small bugs that should be reviewed. |
|
Do you have any ideas on what the bugs are? |
|
On this page look at the comment " DonBeo commented on Dec 24, 2015 " |
|
Ok so it looks like there are a few cosmetic things to investigate and some On Sat, Mar 19, 2016 at 4:15 PM, DonBeo [email protected] wrote:
Peadar Coyle |
|
Thanks it would be very good. I would really like to have this merged but I have been too busy!!! |
|
I'm just curious if any further work been done on this. Perhaps in a different PR? |
|
Unfortunately it's currently asleep and waits for the wake-up call. There is no other PR that continued this work. |
|
I would like to complete it but in the last period I have been too busy. I think it is reasonable to wait that penalized estimator are merged before to continue this one. The PR also contains different parts as the smooth basis and the cross validation. Maybe we should merge some of them as independent PR |
|
is there any news? :( |
|
Unfortunately I can not find enough time to do this. If anyone wants to collaborate I am happy to provide all the required information. I'd like to complete it but I don't really have the time at the moment :-( |
|
@DonBeo @josef-pkt @cgc17 @denadai2 @springcoil I've written a python implementation of GAMs using penalized B splines inspired heavily by Simon Wood and his mgcv C-RAN package. check it out here https://github.com/dswah/pyGAM I've included several model families, as well as link functions and distributions that you can mix and match to make very custom GAMs. I wish I had done more research and contributed to this PR before starting from scratch... |
| penal = kwds.pop('penal', None) | ||
| # I keep the following instead of adding default in pop for future changes | ||
| if penal is None: | ||
| print("Define a penalty") |
There was a problem hiding this comment.
It looks like loglike will break if this is allowed. Maybe this should be a ValueError?
@josef-pkt
This is the cleaned version of the GAM branch.
In order to make it compatible with the latest version of statsmodels I had to remove the
with_metaclasscommand.In addition the
GAMGLMResultsis not working properly anymore as 3 tests fail.They do not fail in my old version.
Let me know.