Skip to content

Pass distribution objects into GLM and GLMCV class #350

Open
@pavanramkumar

Description

@pavanramkumar

Motivation: as we expand the scope of models supported, it may be easier for contributors to add new distributions if we refactor the class to accept distribution-specific params and corresponding likelihood / loss / gradients / hessians as callables.

One strategy inspired by statsmodels proposed by @jasmainak in #274 is as follows:

distr = NegativeBinomial(n_failure)
GLM(distr=distr)
class MyDistribution(BaseDistribution):
    def loglikelihood(self):
        pass
    def loglik_gradient(self):
       pass
   def loglik_hessian(self):
       pass

There are also alternatives such as the scikit-learn approach which is less work for the low touch user who only needs to call fit and predict on a model object without having to construct a distr object:

model = PoissonGLM(base_param1, base_param2, poisson_param1, poisson_param2)
class PoissonGLM(GLM):
    def loglikelihood(self):
        pass
    def loglik_gradient(self):
       pass
   def loglik_hessian(self):
       pass

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions