目标:使用model1(mlogit模型)预测test.csv中的输出(选择)
train <- read.csv("train.csv")
test <- read.csv("test.csv")
traindata <- mlogit.data(train, shape = "wide", choice = "Choice", varying = c(4:83), sep = "", alt.levels = c("Ch1","Ch2","Ch3","Ch4"), id.var = "Case")
testdata <- mlogit.data(test, shape = "wide", choice = "Choice", varying = c(4:83), sep = "", alt.levels = c("Ch1","Ch2","Ch3","Ch4"), id.var = "Case")
model1 <- mlogit(Choice~CC+GN+NS+BU+FA+LD+BZ+FC+FP+RP+PP+KA+SC+TS+NV+MA+LB+AF+HU+Price-1, data=traindata)
概述:我有一套培训和培训。测试数据。训练和测试数据具有相同的功能集,只是训练有标记输出而测试没有。基本上,我将训练数据转换为mlogit数据以创建mlogit模型。但是现在,我很难使用这个模型来预测测试集。谁知道如何解决这个问题?谢谢!