Skip to content

Fix 'undefined columns selected' in predict.bcfmodel with data frame covariates (GH 374)#375

Merged
andrewherren merged 2 commits intomainfrom
gh-374-hotfix
May 1, 2026
Merged

Fix 'undefined columns selected' in predict.bcfmodel with data frame covariates (GH 374)#375
andrewherren merged 2 commits intomainfrom
gh-374-hotfix

Conversation

@andrewherren
Copy link
Copy Markdown
Collaborator

This fixes an R BCF prediction bug unearthed by #374 where covariates are provided as a dataframe (and thus run through the dataframe preprocessor logic) and an internal propensity model is fit. In this case, the order of operations in the predict.bcfmodel function is such that the internal propensity model is called before the preprocessor.

The fix is simple -- invert the order of these two operations. We've also added a unit test to trap this case in the future.

@andrewherren andrewherren merged commit a40781f into main May 1, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"undefined columns selected" error when trying to predict using bcf model

1 participant