Open maarten-jung opened 9 months ago
Thanks for pointing this out! I still try to remember why we did it like this, because we had a similar issue in the past with categorical features and no included intercept. Maybe it's related to the case when there is a bias term in the unstructured part / deep network and hence estimating the effects of all categories would cause an identifiability issue. Will think about it a bit more...
When trying to setup a
deepregression::deepregression
model with one parameter per level of afactor
, I ran into the problems illustrated below.Running
seems to work fine and generates a model with 1 intercept and 9 additional coefficients for each of the non-reference levels:
But with the usual
~ 0 + x
or-1 + x
syntax, we only get 9 coefficients instead of the usual 10 (one per factor level) coefficients that I expected:Setting
check_form = FALSE
in theformula_options
leads to the following errors:The problems seem to be caused by the formula processing in
deepregression:::process_terms
anddeepregression:::separate_define_relation
, but I didn't feel comfortable editing the code in a way that respects the current structure and so didn't create a pull request.For completeness, this is the corresponding
sessionInfo()