Skip to content

GAM prediction and splines #846

Open

Description

@ldkphd

Hello,

I use GAM frequently in R (and as well through rpy2). I am looking for a pythonic implementation to get rid of rpy2 and all memory issues linked to to rpy2.

I checked the gam implementation (not tested yet), but I am missing some functionality to be able to use this implementation.

  1. Prediction function. Once the gam model is build a new set of x-data should be processed to result in an prediction result (like gam.predict in R).
  2. Possibility to retrieve the smoothed splines, to report or implement them independently (not that easy in R as well).

Keep on doing the nice work !!!!

Thanks,

Luc

Activity

  1. josef-pkt commented on May 23, 2013

    @josef-pkt
    Member

    you mean sandbox/gam.py?

    sandbox gam is still unfinished. statsmodels doesn't have splines yet, as far as I remember.

    gam just uses a polynomial fit, that I added (PolySmoother) so I have a test case to fix the iterative solver in AdditiveModel. I refactored and fixed it enough that it runs, but then I had to stop because we don't have splines (and I didn't know much about splines at the time).

    Also, after reading the literature for a while, I wasn't sure whether we actually need the GAM backfitting algorithm, and cannot just do it more easily in one big estimation problem.

  2. ldkphd commented on May 23, 2013

    @ldkphd
    Author

    Indeed, that's it and i am aware of the sandbox as incomplete. Just commenting on the functionality I would like. I am not skilled in the math behind the splines, not sure if there is a big difference between splines and polynomes. I think you should look into the GAM implementation in R (mgcv library of Simon Wood) for inspiration.
    That implementation is an iterative process. One estimation is probably the correct approach...
    I will put my data into the current implementation and see what happens...

    Thanks for the respond...
    Luc

  3. added this to the 0.8 milestone on Jan 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions