This PR addresses the NameError encountered due to the missing import of the 'shuffle' function in the generic_task.py file.
Changes made:
Imported shuffle from sklearn.utils to ensure proper functionality in the data preparation step.
Error message:
File "/xxx/python3.8/site-packages/flaml/automl/task/generic_task.py", line 425, in prepare_data
X_train_all, y_train_all = shuffle(X_train_all, y_train_all, random_state=RANDOM_SEED) NameError: name 'shuffle' is not defined
With this fix, the data shuffling step will execute correctly without raising a NameError.
Closes #1308
Why are these changes needed?
This change resolves a NameError that occurs due to the missing import of the shuffle function. By importing shuffle from sklearn.utils, we ensure that the data preparation step involving shuffling executes correctly, preventing runtime errors and improving the stability of the code.
This PR addresses the NameError encountered due to the missing import of the 'shuffle' function in the
generic_task.py
file.Changes made:
shuffle
fromsklearn.utils
to ensure proper functionality in the data preparation step.Error message:
With this fix, the data shuffling step will execute correctly without raising a NameError.
Closes #1308
Why are these changes needed?
This change resolves a
NameError
that occurs due to the missing import of theshuffle
function. By importingshuffle
fromsklearn.utils
, we ensure that the data preparation step involving shuffling executes correctly, preventing runtime errors and improving the stability of the code.Related issue number
Closes #1308
Checks