fix PrePostNEGD input validation #247
Merged
+12
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This resolves issue #161
I tried the PrePostNEGD example with
group
being binary (current), boolean, or categorical with levels 'A' and 'B'. All three pass the_series_has_2_levels
check but in the prediction after model fitting, errors result in the 'A'/'B' case because 'untreated' is given values of 0 (and 'treated' 1). Switching to_is_variable_dummy_coded
moves the error to a data exception in the input validation, which makes more sense.A more complicated fix would be to assign the two levels in lines 1059 and 1070 rather than 0's and 1's, but then we would need to know which is the 'treatment' level so probably best to leave those transformations to users.
I also fixed a bug that requires the group variable to be called 'group' and adjusted some re-used variable names whose names didn't match what was being stored.