pyGAM icon indicating copy to clipboard operation
pyGAM copied to clipboard

by-variable in pyGAM

Open dhops opened this issue 2 years ago • 1 comments

Hi, I'm just checking on the status of "by-variables" in pyGAM. I saw that "by=" is an option, but when I create a term with by, for example s(3, by=0), the term just becomes s(3).

dhops avatar Oct 05 '21 13:10 dhops

As far as I understand by in pyGAM only implements factors. So if you have array X and use s(3, by=0) it internally fits to the datapoints X[3] * X[0], where X[0] are the actual numbers as floats of your 0th feature column. So if you're planning on using X[0] as a categorical variable list (as in, fit a SEPARATE spline on feature X[3] for every category provided by the categorical label in X[0]) I don't think this is supported in pyGAM. This would be a feature I would appreciate as well @dswah :)

TheSeparatrix avatar May 17 '22 13:05 TheSeparatrix