Speed up GridSearchCV using parallel processing
HTML-код
- Опубликовано: 11 сен 2024
- Want your grid search to run faster? Set n_jobs=-1 to use parallel processing with all CPUs!
👉 New tips every TUESDAY and THURSDAY! 👈
🎥 Watch all tips: • scikit-learn tips
🗒️ Code for all tips: github.com/jus...
💌 Get tips via email: scikit-learn.tips
=== WANT TO GET BETTER AT MACHINE LEARNING? ===
1) LEARN THE FUNDAMENTALS in my intro course (free!): courses.datasc...
2) BUILD YOUR ML CONFIDENCE in my intermediate course: courses.datasc...
3) LET'S CONNECT!
- Newsletter: www.dataschool...
- Twitter: / justmarkham
- Facebook: / datascienceschool
- LinkedIn: / justmarkham
I hope this tip helps your work go faster! ⏰ Another way to save time is to use RandomizedSearchCV instead of GridSearchCV. Watch this video to learn more: ruclips.net/video/Q5dH5mOQ_ik/видео.html
the truth is the calmness of your voice makes learning exciting too
That's great to hear! 🙏
There's more to it than simply setting n_jobs to -1. You also need enough RAM for all those parallel processes to share. Otherwise, you max out your swap space and everything comes to a grinding halt.
Thanks Phil! That's why I always recommend timing your process (with and without n_jobs set to -1) to see if it's helping or not. It's hard to know whether you have enough RAM for any given process without just trying it!
Thank you, it's good to know.
You're welcome!