I want to run a multinomial logistic regression model, to compare the accuracy results of a random forest model in predicting a three-levels outcome.
From what I read, the possible alternatives in R are multinom from nnet package and mlogit. However, I one-hot encoded the categorical predictors in my dataset (they are four in total) without dropping any variable level (i.e., the variable "color" with levels "green", "red", "yellow" is encoded as three dummy variables, one for each color) to run the random forest model. From what I know, this should be an issue for estimating the multinomial logistic regression parameters due to multicollinearity. Indeed, when I try to run the mlogit regression, I get Error in solve.default(H, g[!fixed]) : Lapack routine dgesv: system is exactly singular: U[4,4] = 0 . Instead, I do not get any error in running the model with multinom. Why is it the case?