handson-ml
handson-ml copied to clipboard
Chapter 2: SettingWithCopyWarning
Thanks for the good book, currently I'm reading the second chapter and at some points my results are not the same as the notebook (pretty much all of the predictions). I think the reason could be cell 30:
for set_ in (strat_train_set, strat_test_set):
set_.drop("income_cat", axis=1, inplace=True)
which throws the warning in the title.
I was able to replicate the results perfectly and even implement other solutions to the problmes using other methods. If there's any error with reproducibility, that is probably not the source of it.
Have you set the numpy random seed to 42 en every instance needed?
Hi @r-ichi , Thanks for your feedback. Could you please indicate which versions you are using for your OS, Python, Pandas, NumPy and Scikit-Learn?
Absolutely. By the way, thanks for your amazing work. Python version: Anaconda 3.6.5 :: Anaconda custom (64-bit) OS version: Windows 10 64bit (I hope I got this right, if you meant something else, please let me know) Pandas version: 0.23.0 Numpy version: 1.14.3 SKLearn version: 0.19.1
Greetings from Chile.
Sorry I didn't get back to you. Did you solve this issue?
i too getting the same type of error would you plese give me the answer
could you describe your error more specifically and/or provide a screenshot?
i restarted the kernal and run the code again it solved for set_ in (strat_train_set, strat_test_set): set_.drop("income_cat", axis=1, inplace=True)
in this it was throwing an error of set_ not defined at that time
Thanks for reply