asadoughi / stat-learning

Notes and exercise attempts for "An Introduction to Statistical Learning"
http://asadoughi.github.io/stat-learning
2.12k stars 1.62k forks source link

Ch5 lab 7 #74

Open AnatoliiStepaniuk opened 7 years ago

AnatoliiStepaniuk commented 7 years ago

I've also got the answer to this exercise close to 0.45. But if cv.glm is used, I get an answer around 0.25 which is confusing:

glm.fit.all <- glm(Direction ~ Lag1 + Lag2) LOOCV_error <- cv.glm(frame, glm.fit.all)$delta[1] # is around 0.25 instead of 0.45

Can anyone clarify this? Thank you!