How to calculate cross validation error for ridge regression model?
问题 I am trying to fit a ridge regression model on the white wine dataset. I want to use the entire dataset for training and use 10 fold CV for calculating the test error rate. Thats the main question - how to calculate CV test error for a ridge regressed logistic model. I calculated the best value of lambda (also using CV ), and now I want to find the CV test error rate. Currently, my code for calculating the said CV test error is - cost1 <- function(good, pi=0) mean(abs(good-pi) > 0.5) ridge