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

Possible logic error with inner_folds in nestcv.train? #40

Closed
DarwinAwardWinner opened this issue Dec 16, 2024 · 1 comment
Closed

Possible logic error with inner_folds in nestcv.train? #40

DarwinAwardWinner opened this issue Dec 16, 2024 · 1 comment

Comments

@DarwinAwardWinner
Copy link

I was reading the code of nestcv.train and I noticed this line: https://github.com/myles-lewis/nestedcv/blob/main/R/nestcv.train.R#L278C7-L278C111

Currently it says:

if (n_inner_folds != length(inner_folds)) stop("Mismatch between n_inner_folds and length(inner_folds)")

but I think it should say:

if (n_inner_folds != length(inner_folds[[1]])) stop("Mismatch between n_inner_folds and length(inner_folds)")

I haven't had a chance to test this yet, but I will be soon, since I have a situation where I need to manually generate both outer and inner folds. My expectation is that the code in its current state will always throw an error if length(inner_folds[[1]]) != length(inner_folds).

@myles-lewis
Copy link
Owner

Hi @DarwinAwardWinner

I think you are correct. I've pushed the fix you suggested to main.

Thanks!
Best, Myles

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