You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm aware of one specific problem. It occurs when fitted is passed a data frame in which a categorical column includes a level not present in the data on which inference was performed. In this situation, rows in which the categorical column takes on this superfluous level are coded incorrectly.
importpandasaspdfrombrmpimportdefmfrombrmp.fitimportfittedfrombrmp.designimportpredictorsdf=pd.DataFrame(dict(
y=[0.,1.],
a=pd.Categorical(['a0','a1']),
))
fit=defm('y ~ a', df).fit(iter=5)
df2=pd.DataFrame(dict(
# level 'a2' is not present in dfa=pd.Categorical(['a0','a1','a2']),
))
# `fitted` does something like this internally:data=predictors(fit.formula, df2, fit.metadata, {})
print(data['X'])
# [[1. 0.] # a0# [0. 1.] # ... and a1 are coded correctly,# [0. 0.]] # ... but the new level is a row of zeros
It's possible that there are further notions of compatibility that we ought to check for.
The text was updated successfully, but these errors were encountered:
I'm aware of one specific problem. It occurs when
fitted
is passed a data frame in which a categorical column includes a level not present in the data on which inference was performed. In this situation, rows in which the categorical column takes on this superfluous level are coded incorrectly.It's possible that there are further notions of compatibility that we ought to check for.
The text was updated successfully, but these errors were encountered: