Stratified K-fold validation using crossval funtion
2 次查看(过去 30 天)
显示 更早的评论
I am trying to customize the "Weighted kNN"-based classification code generated after a 10-fold cross validation on my data using the Classification Learner App (Using the Generate Function option in the app).
Query 1:
partitionedModel = crossval(trainedClassifier.ClassificationKNN, 'KFold',10);
After generating the code, I found that the above code is responsible for partitioning the data. I have an imbalanced dataset and I believe that "Stratified" k-fold cross validation ensures equal amount of data is considered from each class.
Query: Does the above code automatically perform Stratified k-fold cross validation? If not, how do I include it in the code?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Classification Ensembles 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!