Posts

Showing posts with the label RFC

What is Cross-Validation? Perform K-fold cross-validation without sklearn cross_val_score function on SVM and Random Forest

Image
Cross-validation is a model evaluation method. Generally, we use it to check the overfitting of the trained model. If the whole dataset is divided into train and test data, then the chances are high that the train model might not perform well on unseen (test) data. We can tackle this problem by dividing the whole dataset into 3 sets: train, validation and test dataset. Validation set will be used to check performance before test data is applied. There are several methods to perform cross-validation such as holdout, K-fold, leave-one-out cross-validation . There are plenty of machine learning tools in python. The range varies from sci-kit -learn, TensorFlow, Keras, Theano, Microsoft CNTK. All of these provide excellent support and tools to build your models, work through datasets. In this post, we will see an alternate way to k-fold cross-validation . Further, we will use the script for SVM and Random Forest Classifier. K-Fold Cross Validation We divide the whole dataset...