Skip to content

skip_one set correctly in IRLS tests? #4935

Open

Description

@jbrockmendel

In test_glm and test_glm_weights a bunch of tests are run in a loop in test_wtd_gradient_irls, test_gradient_irls_eim, test_gradient_irls. In each of these a variable skip_one is set to False outside the loop, then in one location in the loop is set to True. Is that intentional? it seems more likely in context that skip_one should be set to False in every step of the loop except for that one.

Activity

  1. jbrockmendel commented on Aug 18, 2018

    @jbrockmendel
    ContributorAuthor

    It also looks like the case where skip_one is set to True also fails to define lin_pred, so it will keep the lin_pred from the last stage of the loop. This seems very likely unintentional. @josef-pkt any idea?

  2. josef-pkt commented on Aug 18, 2018

    @josef-pkt
    Member

    I'm pretty sure it's intentional to skip some irls cases, but I'm not sure whether it works as intended.
    (I haven't looked at it long enough to figure out again what might be the intention. )

  3. jbrockmendel commented on Aug 18, 2018

    @jbrockmendel
    ContributorAuthor

    I think you're right that it is to skip some irls cases, but I think that the way it is written is likely not the way it is intended. It looks like the intention is to skip the one specific case where skip_one is overriden, but the behavior is to skip that case and all subsequent cases in the loop.

  4. josef-pkt commented on Aug 18, 2018

    @josef-pkt
    Member

    I think so too, my guess is that the initialization to skip_one = False is supposed to be inside the loop.

    I briefly tried to follow the commit/PR/issue, but didn't find anything that quickly explains which convergence failures are avoided by this #2834
    7fdcd23

  5. jbrockmendel commented on Aug 18, 2018

    @jbrockmendel
    ContributorAuthor

    OK. I'll see if changing that breaks any tests and if not, update the PR.

  6. jbrockmendel commented on Aug 18, 2018

    @jbrockmendel
    ContributorAuthor

    Looks like this causes one more case to fail. I updated the PR so it sets skip_one = True in only the relevant cases and otherwise sets it to False inside the loop.

    As to the difference in lin_pred in test_glm_weights, making it match causes a failure in one case where params only match up to two decimal places. For now I'm skipping that precise case using skip_one.

    Identifying troublesome cases will be easier after moving to parametrize

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions