K-nearest neighbour Classifier- Cross validation

Hi, I am working of classifiers. My problem is as follow:
train_labels = Nx1; train_data = NxD;
test_ labels = Mx1; test_data = MxD;
where, M>>N;
I am using Knn classifier and I have to find the classification accuracy by k-fold cross-validation. Any help?

1 件のコメント

PIRC
PIRC 2023 年 8 月 30 日
which is helpful for identify the optimal K value and avoid overfitting, underfitting issues

サインインしてコメントする。

回答 (1 件)

Tom Lane
Tom Lane 2013 年 1 月 11 日

0 投票

This example illustrates k-fold cross validation for knn classification:
However, you ordinarily wouldn't divide your data into train/test sets if you were going to use cross-validation.

質問済み:

2013 年 1 月 10 日

コメント済み:

2023 年 8 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by