Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparison length > 1 in cv_data_slice. #406

Open
broesler opened this issue Jul 18, 2023 · 0 comments
Open

Comparison length > 1 in cv_data_slice. #406

broesler opened this issue Jul 18, 2023 · 0 comments

Comments

@broesler
Copy link

While working through the 2nd book edition, I went to run R code 7.17 in the Overthinking box n p 210 (Chapter 7). The book code runs as is, but I was interested in computing the LOOCV value to replicate Figure 7.10, so I ran r <- sim_train_test( N=N, k=k, LOOCV=TRUE). I got an error which I traced back to the following line of cv_data_slice:

if (class(dlo[[vname]]) == "numeric") link to source

The call class(dlo[["mm"]]) returns "matrix" "array", so the comparison to "numeric" returns FALSE FALSE, which has length > 1, causing the error. I'm not sure the best way to correct this multiple class type issue, but will work on a PR unless someone beats me to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant