MATLAB Answers

How does k-fold cross validation work in KNN?

15 views (last 30 days)
Samuel L. Polk
Samuel L. Polk on 10 Dec 2018
Answered: Don Mathis on 13 Dec 2018
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?

  0 Comments

Sign in to comment.

Accepted Answer

Don Mathis
Don Mathis on 13 Dec 2018
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 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.