Skip to content

Formula parsing is bugged; predictions re-parse a new formula. #840

@DTchebotarev

Description

@DTchebotarev

There is a bug in the way that pyfixest parses formulas. It's illustrated simply with this code:

Image

You can see I vary the categorical variable, but the prediction stays the same. This is because pyfixest parses the string formula from scratch in the predict method with the newdata dataframe. I have drafted a PR that addresses this by storing the formulaic modelspec object and re-using that for creating the model matrix when doing out of sample predictions: #839

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