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

cv.kknn fold sizes are different #14

Open
mkuehn10 opened this issue Sep 2, 2018 · 3 comments
Open

cv.kknn fold sizes are different #14

mkuehn10 opened this issue Sep 2, 2018 · 3 comments

Comments

@mkuehn10
Copy link

mkuehn10 commented Sep 2, 2018

The line val<-sample(kcv, size=l, replace=TRUE) has the potential to make different sized folds for the cross-validation.

A simple fix could be to do val <- cut(seq(1, nrow(data)), breaks = kcv, labels = FALSE) instead to make the folds as similar in size as possible.

mkuehn10 added a commit to mkuehn10/kknn that referenced this issue Sep 2, 2018
@mkuehn10
Copy link
Author

mkuehn10 commented Sep 2, 2018

I also added a random shuffling of the rows of the data that is passed in prior to assigning folds.

data <- data[sample(nrow(data)),]

@KlausVigo
Copy link
Owner

Hi @mkuehn10 ,
thanks for the opening the issues and pull requests. I am giving a course this week, I will come back to this next week.
Klaus

@mkuehn10
Copy link
Author

Hello @KlausVigo. Have you had any chance to look this over?

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

2 participants