fix: KeyError no longer occurs when using groupfolds for regression tasks.#1385
Conversation
thinkall
left a comment
There was a problem hiding this comment.
Thank you @dannycg1996 for the PR. Please see my comments in #1384 .
thinkall
left a comment
There was a problem hiding this comment.
Since we're allowing group for regression task. Do you mind update the related docstring as well? Thanks.
|
Thanks @thinkall - I have updated the docs. Please let me know if I've missed anything! |
I can make a release once your PR is merged. |
|
That's great - thanks! |
Why are these changes needed?
Currently KeyErrors are raised (under certain conditions outlined in the linked issue) when using AutoML for regression tasks, with GroupKFold splits.
This was caused by the index not being reset for group folds.
As part of this PR, I've modified the if statement in
prepare_datato ensure that we now also reset the index, regardless of the split type. This will ensure that this error doesn't occur when group folds are used, or when custom splitters are passed in. I've also added a test, which checks that my example code from the linked issue can now run without errors.Hopefully that's merge-able - please let me know if you have any suggestions/comments.
Thanks!
Related issue number
Close #1384
Closes #1254
Checks