I think that the conversion of factor variables to numeric before applying aoa() causes unintended treatment of categorical variables as numeric. In fact, conversion to dummy variables is intended to happen within aoa() which should not trigger if converted to numeric early.
(CC: @Nowosad)
|
if (any(is.factor(newdata))) |
|
newdata[[which(is.factor(newdata))]] <- as.numeric(newdata[[which(is.factor(newdata))]]) |
I think that the conversion of factor variables to numeric before applying
aoa()causes unintended treatment of categorical variables as numeric. In fact, conversion to dummy variables is intended to happen withinaoa()which should not trigger if converted to numeric early.(CC: @Nowosad)
CAST/R/aoa.R
Lines 187 to 188 in 716a035