Hi All, 

I have a fitted model called glm.fit which I used glm and data dat is my data 
frame

pred= predict(glm.fit, data = dat, type="response") 

to predict how it predicts on my whole data but obviously I have to do 
cross-validation to train the model on one part of my data and predict on the 
other part. So, I searched for it and I found a function cv.glm which is in 
package boot. So, I tired to use it as:

cv.glm = (cv.glm(dat, glm.fit, cost, K=nrow(dat))$delta)

but I am not sure how to do the prediction for the hold-out data. Is there any 
better way for cross-validation to learn a model on training data and test it 
on test data in R? 

Thanks,
Andra

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to