How does k-fold cross validation work in KNN?

조회 수: 3 (최근 30일)
Samuel L. Polk
Samuel L. Polk 2018년 12월 10일
답변: Don Mathis 2018년 12월 13일
My understanding is that KNN uses the classifications of the k data nearest to a query point in order to inform the classification of the query point. I was wondering how K-fold cross validation affects the ability of the KNN classifier in the classificationLearner toolbox in Matlab. My understanding of K-Fold CV is that it is used to make sure that out-of-sample data is predicted well. But also, one can use cross validation to optimize hyperparameters. Is something like this happening with KNN too? If so, what hyperparameters are being optimized through the use of KNN in classificationLearner?

채택된 답변

Don Mathis
Don Mathis 2018년 12월 13일
There is currently no automatic hyperparameter optimization in the classificationLearner. It just uses the hyperparameters you have chosen and runs cross-validation to estimate the out-of-sample loss.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by