Skip to content

Commit

Permalink
Bug fix for factor encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
JoKra1 committed Jul 9, 2024
1 parent 06a9bae commit 4b15c39
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mssm/src/python/formula.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,12 @@ def __init__(self,
if isinstance(term,fs):
if not term.approx_deriv is None:
self.discretize[ti] = term.approx_deriv

# Make sure all categorical split variables end up being encoded since
# they do not necessarily have to be in the formula in case of
# sub-groups.
for split_by_fac in self.discretize[ti]["split_by"]:
cvi = self.__encode_var(split_by_fac,'O',cvi,codebook)

# All variables must exist in data
for var in term.variables:
Expand Down

0 comments on commit 4b15c39

Please sign in to comment.