How to find the best model parameters in scikit-learn




[ad_1]

In this video, you’ll learn how to efficiently search for the optimal tuning parameters (or “hyperparameters”) for your machine learning model in order to maximize its performance. I’ll start by demonstrating an exhaustive “grid search” process using scikit-learn’s GridSearchCV class, and then I’ll compare it with RandomizedSearchCV, which can often achieve similar results in far less time.

Download the notebook: https://github.com/justmarkham/scikit-learn-videos
Grid search user guide: http://scikit-learn.org/stable/modules/grid_search.html
GridSearchCV documentation: http://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html
RandomizedSearchCV documentation: http://scikit-learn.org/stable/modules/generated/sklearn.model_selection.RandomizedSearchCV.html
Comparing randomized search and grid search: http://scikit-learn.org/stable/auto_examples/model_selection/plot_randomized_search.html
Randomized search video: https://youtu.be/0wUF_Ov8b0A?t=17m38s
Randomized search notebook: https://github.com/amueller/pydata-nyc-advanced-sklearn/blob/master/Chapter%203%20-%20Randomized%20Hyper%20Parameter%20Search.ipynb
Random Search for Hyper-Parameter Optimization: http://www.jmlr.org/papers/volume13/bergstra12a/bergstra12a.pdf

WANT TO GET BETTER AT MACHINE LEARNING? HERE ARE YOUR NEXT STEPS:

1) WATCH my scikit-learn video series:
https://www.youtube.com/playlist?list=PL5-da3qGB5ICeMbQuqbbCOQWcS6OYBr5A

2) SUBSCRIBE for more videos:
https://www.youtube.com/dataschool?sub_confirmation=1

3) JOIN “Data School Insiders” to access bonus content:
https://www.patreon.com/dataschool

4) ENROLL in my Machine Learning course:
https://www.dataschool.io/learn/

5) LET’S CONNECT!
– Newsletter: https://www.dataschool.io/subscribe/
– Twitter: https://twitter.com/justmarkham
– Facebook: https://www.facebook.com/DataScienceSchool/
– LinkedIn: https://www.linkedin.com/in/justmarkham/

Source


[ad_2]

Comment List

  • Data School
    November 30, 2020

    Note: This video was recorded using Python 2.7 and scikit-learn 0.16. Recently, I updated the code to use Python 3.6 and scikit-learn 0.19.1. You can download the updated code here: https://github.com/justmarkham/scikit-learn-videos

  • Data School
    November 30, 2020

    Another amazing video! Thank you!

  • Data School
    November 30, 2020

    You are doing great!

  • Data School
    November 30, 2020

    I like the way you explain everything so slowly and briefly. Thank you for such a quality content on ML!

  • Data School
    November 30, 2020

    Love simplicity in your approach! Excuse me for my naive question – So How to determine if cluster size 13 is optimal or 17 is optimal? If one was to use said KNN logic in a TRULY real life situation, should he choose 13 or 17?

  • Data School
    November 30, 2020

    Thank you so much for this clear and helpful tutorial and all the effort you put in to your work 🌸^^

  • Data School
    November 30, 2020

    Mantap videonya.
    Saya juga ada nih rekomendasi lain buat belajar Tuning Hyperparameter pada python 3 siapa tau cocok hehe.

    https://youtu.be/IzwOkGuZpsE

  • Data School
    November 30, 2020

    Thank you so much, one of the best and clearest explanation I've ever came across!!

  • Data School
    November 30, 2020

    your classes are simply AMAZING, thank you so much for all your efforts putting them together!

  • Data School
    November 30, 2020

    Fantastic. We should all join his support group. 5 a month is cheap

  • Data School
    November 30, 2020

    Very good video, very good explanation. Thank you!

  • Data School
    November 30, 2020

    Thaanks! Congrats Its a great explanation! I was also checking some other videos of yours and a doubt appeared, I wanted to combine the pipe with the gridsearch. For instance I tried to put down the gridsearch within my pipeline and extract the results as pipe.cv_results_, however could not use the .cv_results with pipe. Could you give any hint about the combination pipe for preprocessing and then search grid? Maybe another topic for your videos Thanks!

  • Data School
    November 30, 2020

    I suggest anyone learning Datascience to download curriculum from any DataScience Bootcamp and learn everything in that curriculum from Dataschool videos.

  • Data School
    November 30, 2020

    may be its an update, it is now from sklearn.model_selection import GridSearchCV

  • Data School
    November 30, 2020

    At some point my eyes became teary while watching this series. I have never come across such an amazing and passionate teacher. you explain every single thing, even the questions that pop up in my mind it feels like you foresee and address them, what's baffling is that you even tag them as questions before answering them. The additional resources are also pure gold. My God will bless you sir, may you live long and always be happy

  • Data School
    November 30, 2020

    thankyu very much sir, this video helps me a lot

  • Data School
    November 30, 2020

    Thank you very much for such a very beautiful explanation!!!

  • Data School
    November 30, 2020

    its great i came across your clips… one of the BEST explantions out there.
    thanks a lot

  • Data School
    November 30, 2020

    u r a great teacher, optimazation, gridsearch, exhaustive search were a mist to me, nut now bcz of u, they kind of on my finger tips

  • Data School
    November 30, 2020

    19:00 Isn't that training with the entire data will violate data snooping? kind of confused here.

  • Data School
    November 30, 2020

    really awesome…. great work man… and thank youuuuu

  • Data School
    November 30, 2020

    Your explanation makes each and every topic so simple and easy to understand. Really, I would like to thank you for your immense efforts for all your videos which are so informative and added resources help us to dig deeper in the related topics.

Write a comment