Import libraries and set style
s2 · run_code workaroundHandle both old and new scikit-learn locations for train_test_split, use seaborn's set_context for the poster style, and remove the Jupyter magic command.
The tutorial now runs successfully after applying a workaround. It originally failed with a ModuleNotFoundError because the sklearn.cross_validation submodule (containing train_test_split) was removed in newer scikit-learn releases, and the matplotlib style used for seaborn posters was also dropped. The fix wraps the import in a try/except to import train_test_split from sklearn.model_selection and sets the seaborn poster context directly via seaborn, eliminating the dependency on the removed APIs.
Handle both old and new scikit-learn locations for train_test_split, use seaborn's set_context for the poster style, and remove the Jupyter magic command.
Send them what broke and the fix, so the next reader doesn't hit the same error.
Add it to the tutorial so readers know when it was last checked.
[](https://fix-my-tutorial.onrender.com/r/ri-IAYs65jl)
<a href="https://fix-my-tutorial.onrender.com/r/ri-IAYs65jl"><img src="https://fix-my-tutorial.onrender.com/badge/ri-IAYs65jl.svg" alt="Fix My Tutorial"></a>