I need to make a classification using logistic regression.
test data and training set are set like this:
train = data.frame( x1 = c(1,2,3), x2 = c(3,4,5), y = c(1,1,0)) test = data.frame( x1 = c(1,2,5), x2 = c(1,3,5))
How to implement this code?
I tried, but in the end bugs came out
mldata <- mlogit.data(train, choice = "y") formula = as.formula(paste("y ~ ", "x1+x2")) mlogitModel = mlogit(formula, mldata) pred = preict(mlogit_model, test)