model_one <-glm(
Survived ~ age_imputed,
family = binomial(),
data = train_imputed
)
logistic_cv1 <- cv.glm(train_imputed, model_1, cost, K=5)
logistic_cv1$delta
I'm trying to use k-fold cross-validation to measure our model's performance on data. So I used glm function but after I run the code, this error message pops up,
Error in cv.glm(train_imputed, model_1, cost, K = 5) : object 'model_1' not found
How to fix this problem? I found it weird I saved model_1 as a new variable. But I couldn't find its dataset.