Skip to content

Distributions (Gamma, Poisson) #3

@benman1

Description

@benman1

Hi
Thanks for creating the repo (nicely maintained and good to read). I have a problem, however.

I am trying to use other distribution families, like Poisson or Gamma. So I create the GLM as follows:

Glm glm = new Glm(GlmSolverType.GlmIrlsSvd, GlmDistributionFamily.Gamma) glm.fit(dMatrix)

or

Glm glm = new Glm() glm.distributionFamily = GlmDistributionFamily.Poisson glm.fit(dMatrix)

I only get nans in either case for predictions. Is there anything I am missing here? If I change this to linear. I get non-nan results on my test dataset (iris).

For some values of distribution family, such as InverseGaussian, I even get null exceptions from GlmAlgorithm (state is null).

protected TerminationEvaluationMethod shouldTerminate = (state, iteration) -> { if (state.improved() && state.improvement() >= this.mTol) { return iteration >= this.maxIters; } else { return false; } };

Help appreciated.
Thanks again
Ben.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions