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

Can gbm.step (and other functions) have a line to automatically convert input data to data.frame OR warn if tibble, etc.? #35

Open
dtickler-MF opened this issue Feb 23, 2023 · 0 comments

Comments

@dtickler-MF
Copy link

Just spent an instructive half hour changing lines in the gbm.step code to get around an error which presented as:

Error in y.data[model.mask]:
! Can't subset columns with model.mask.
x Logical subscript model.mask must be size 1 or 1, not 3779.

Turns out I'd tidied up my code and deleted the line where I converted my dataset into a data.frame, meaning it was left as a tibble after importing the raw data and manipulating it with dplyr.

Result of this is that eval() interpreted by gbm.y variable as a one variable tibble not a vector. Subsequent attempts to subset the y variable for folding etc. then fail throughout the gbm.step code. I 'fixed' this by changing all the lines that didn't work, before realising that the problem was the format of my input data!!!

Can the gbm.step code be modified so that it either converts to a data.frame (with or without a message) OR exits with a warning that the input data are not in the correct format/class?

In the meantime I'll just follow the help file instructions that clearly say that the Argument 'data' must be a data.frame!!

Cheers!

David Tickler

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