dswah / pyGAM

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

Constraint to obtain non-negative predict( ) output? #234

Closed ghost closed 5 years ago

ghost commented 5 years ago

I recently started using pygam and based on the docs there does not seem to be an explicit constraint I can use to constrain output from the gam.predict as positive. Would you know of any alternate approach I could take to constrain my output to only positive values? Thanks.

dswah commented 5 years ago

Hey @L4student! Yes, the way to do this is to choose a distribution that only produces positive values like Gamma or Poisson.

I would suggest you try the GammaGAM or PoissonGAM, depending on if you're modeling continuous or discrete values.

dswah commented 5 years ago

Hey @L4student! Yes, the way to do this is to choose a distribution that only produces positive values like Gamma or Poisson.

I would suggest you try the GammaGAM or PoissonGAM, depending on if you're modeling continuous or discrete values.

ghost commented 5 years ago

Thanks for the answer, @dswah .