How to check and interpret the result of K-fold cross validation in R?

r
crossvalidation

#1

Hello,

I was following this code on K fold cross validation technique but I dont seem to undersatnd how to interpret the result.

https://gist.github.com/bhoung/11237681

Can someone enlighten upon this?

thanks


#2

The final result is still the prediction of sepal length for each input. But here, k-fold cross validation is done. So if you print the output at each step in the for loop as follows:

temp <- as.data.frame(predict(mymodel, testset[,-1]))
print(temp) #Add this line
prediction <- rbind(prediction, temp)

It will be very easy for you to see the progress as the code runs and the values that are generated at every iteration.

Hope this helps!