301 - Evaluating keras model using KFold cross validation
Ғылым және технология
Code generated in the video can be downloaded from here:
github.com/bnsreenu/python_fo...
Direct link: github.com/bnsreenu/python_fo...
We will start with the normal way most of us approach the problem of binary classification using neural networks (deep learning). In this example, we will split our data set the normal way into train and test groups.
Then, we will learn to divide data using K Fold splits.
We will iterate through each split to train and evaluate our model.
Normally, we would use cross_val_score in sklearn to automatically evaluate
the model over all splits and report the cross validation score. But, that method is designed to handle traditional sklearn models such as SVM, RF,
gradient boosting etc. - NOT deep learning models from TensorFlow or pytorch.
Therefore, in order to use cross_val_score, we will find a way to make our
keras model available to the function. This is done using the KerasClassifier
from tensorflow.keras.wrappers.scikit_learn
Note that the cross_val_score() function takes the dataset and cross-validation configuration and returns a list of scores calculated for each fold.
Wisconsin breast cancer example
Dataset link: www.kaggle.com/datasets/uciml...
Пікірлер: 18
I thought I know this method until watching this video. You are the best. Thank You Sir
The progression of your videos has followed the exact progression of my graduate research over the last 2 years. Whenever I need to learn how to implement something I immediately find a recent video from you. Funny how things work!
Fantastic video Prof Sreeni, it was really useful!
Very informative Video, this is very cool, I can wait for the next video. Sorry, Are you going to show another video using an image dataset?
This was sooooooo Helpful in my Research Project. Thanks!
@DigitalSreeni
11 ай бұрын
Glad it was helpful!
Thank you for your work! Сould you please touch upon of the subject of pseudo labels for segmentation🙌
Hello Sir. Thank you for your work. It would be really helpful if you could implement transformer-based models for segmentation like transunet or segformer.
This has been very helpful and thank you so much for that. I have one question though. What if I have an independent test set and i want to test my model's prediction for that set, how do i do it? Every cross validation article/ tutorial I have come across ends with printing the average accuracy. How do I test my model for independent test set?
how i can use cross validation for models deep learning
Hi sir, excellent videos, can u pls try with automatic plant disease detection
Hi prof, could you tell me the python version that you're using? The latest libraries seem to have some compatibility issues, and the cross_val_score did not work for me.
Very nice explanation! But I had a major query regarding the number of epochs you chose to train the model. How do one decide on that since it can lead to overfitting
@theronealmadin1077
10 ай бұрын
Legit just Trial and Error
i love u.
Which books do you recommend?
I can't find the csv file anywhere. Can you help me ?
@DigitalSreeni
5 ай бұрын
Just checked the link I provided in my comments, it still works.