ich möchte eine Kreuzvalidierung für einen Datensatz mit einer binären Zielvariable machen. Meine Formel sieht wie folgt aus:
Code: Alles auswählen
train_control<-trainControl(method="repeatedcv",number=10,repeats=1)
model<-train(zielvariable~v1+v2,data=Datensatz,method="glm",family="binomial",trControl=train_control)
print(model)
Code: Alles auswählen
Warning message:
In train.default(x, y, weights = w, ...) :
You are trying to do regression and your outcome only has two possible values Are you trying to do classification? If so, use a 2 level factor as your outcome column.
Ich habe alles aus ChatGPT versucht (summaryfunction, classProbs, Metric=Accuracy), nur Fehlermeldungen.
Kann mir jemand helfen?
Danke!
Ma