Machine Learning Tutorial Python - 16: Hyper parameter Tuning (GridSearchCV)

preview_player
Показать описание
In this python machine learning tutorial for beginners we will look into,
1) how to hyper tune machine learning model paramers
2) choose best model for given machine learning problem
We will start by comparing traditional train_test_split approach with k fold cross validation. Then we will see how GridSearchCV helps run K Fold cross validation with its convenient api. GridSearchCV helps find best parameters that gives maximum performance. RandomizedSearchCV is another class in sklearn library that does same thing as GridSearchCV
but without running exhaustive search, this helps with computation time and resources. We will also see how to find best model among all the classification algorithm using GridSearchCV. In the end we have interesting exercise for you to solve.

#MachineLearning #PythonMachineLearning #MachineLearningTutorial #Python #PythonTutorial #PythonTraining #MachineLearningCource #HyperParameter #GridSearchCV #sklearntutorials #scikitlearntutorials

Topics that are covered in this Video:
00:00 Introduction
00:45 train_test_split to find model performance
01:37 K fold cross validation
04:44 GridSearchCV for hyperparameter tuning
10:18 RandomizedSearchCV
12:35 Choosing best model
15:25 Exercise

Next Video:

Populor Playlist:

Tools and Libraries:
Scikit learn tutorials
Sklearn tutorials
Machine learning with scikit learn tutorials
Machine learning with sklearn tutorials

#️⃣ Social Media #️⃣
Рекомендации по теме
Комментарии
Автор

Thank you sir.I also completed your ml course in your previous videos in last year.Now i'm in interview process for getting job, your videos really helped me.I'm a house wife and learning from home (your videos).Thank you a lot.god bless you.

gurtejkaur
Автор

I learned more in last 5 mins of this video than I have in a week studying on my own

codecomedytv
Автор

Thanks for your wonderful tutorials
Best Model = SVM
Best parameter = {'C': 10, 'gamma': 'scale', 'kernel': 'rbf'}
Score = 0.973850 accuracy (97.4%)

Emmanuel-gfxv
Автор

Hi Dhaval, your tutorials are very informative and very helpful for self learning. Kudos!!!
Here is some of best score with optimal parameters for the exercise.
1 svm --> 0.992045 {'C': 10, 'gamma': 'scale', 'kernel': 'rbf', '...
2 random_forest --> 0.994435 {'criterion': 'gini', 'n_estimators': 100}
3 logistic_regression --> 0.980114 {'C': 1, 'multi_class': 'auto', 'penalty': 'l1...
4 GaussianNB--> 0.995225 {}
5 DecisionTreeClassifier 'gini', 'splitter': 'best'}

udayashangar
Автор

Can't really express how lucky I am to have found you. By far the best tutorial on machine learning

kelvinmcanim
Автор

You got me sir, i was roaming here and there but you covered almost everything in one video thats the spirit sir and salute sir .

basantgiri
Автор

To be honest, I don't understand much the parameters' definition. But also gave it a try. Thanks a lot for this tutorial, sir!!!
svm 0.973850 {'C': 10, 'gamma': 'scale', 'kernel': 'rbf'}
10}
2, 'solver': 'liblinear'}
GaussianNB 0.806928 {}
MultinomialNB 0.870350 {}
'gini'}

jhwooks
Автор

Hey Dhaval,
My sincere thanks to you and the efforts you have taken. I do not have much background in AI and ML, your videos make me feel that even a novice can learn and excel in this field. I am consistently watching your videos and exploring things out. A must series for every learner. Best wishes to you.

viveksoni
Автор

Thank you very much sir for teaching this wonderful Machine Learning course. Now I am able to enjoy the ML Models better than earlier. I have found SVM model as best model for digits datasets
Here are the scores using GridSearchCV
model best_score best_params
svm 0.947697 {'C': 1, 'kernel': 'linear'}
random_forest 0.903757 {'n_estimators': 10}
logistic_regression 0.922114 {'C': 1}
gaussian_nb 0.806928 {'var_smoothing': 1e-09}
multinomial_nb 0.876476 {'alpha': 1000}
decision_tree 0.732934 {'max_leaf_nodes': 20, 'min_samples_split': 2}

koushikccbp.
Автор

Very nice intro, really helped me when I was following an applied ML book and needed to get better understanding than presented in text.Thanks

snehil
Автор

Tbh this is the toughest tutorial in the playlist everything took me around 2-3 hrs a day but this taken around 2 days as we have to see all the parameters and do the tunning and selecting the best model I got SVM as the best model for the digits dataset
Thank you for giving such a good playlist

saisanthosh
Автор

This is very helpful for increasing accuracy. A good tutorial. Thank you :-)

flamboyantperson
Автор

Thank You Sir!
This was my best model for the given exercise:

Support Vector Machine 0.986084 SVC(C = 1, gamma = 'auto', kernel = 'poly')

saksham_
Автор

Inspired by your teaching style sir i am frm india and just joined Intellipaat (IIT Roorkee University) for Data science and Ai, but since mentor is teaching style is not good i have to see your videos to learn even better thanks sir for providing such a valuable and free stuff on youTube i will also join your one of the course of Excel

bhagirathsinhjadeja
Автор

I have doubt on the diff between cross val score & grid search cv for long time. you just solved it in a single video. Excellent work. Thank you very much.

lukeswift
Автор

one line for you: "sophisticated code made simple" . Thank you. was really helpful .

theduffrichie
Автор

Very Comprehensive Tutorial.
I did feature scaling before training the models
Best Model: SVM
Parameters: {C=10.0, Gamma = 'scale', Kernel = 'rbf'}
Accuracy Score: 0.9749628597957288, approx 97.5%

jilhenry
Автор

Best_Model: svm
Score: 0.947697
params: {'C': 1, 'kernel': 'linear'}

sakalagamingyt
Автор

Thank you sir ! .Results :
model best_score best_params
0 svm 0.980000 {'C': 1, 'kernel': 'rbf'}

srimannarayanakodem
Автор

wow....this is what I was looking for i.e how to compare results of different model with different Parameters....you have consolidated all and shown easy methods.... tks a lot sir....very helpful...

yogeshbharadwaj