K-nearest neighbour Classifier- Cross validation

조회 수: 13 (최근 30일)
dopedmind
dopedmind 2013년 1월 10일
댓글: PIRC 2023년 8월 30일
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일
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.

Community Treasure Hunt

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

Start Hunting!

Translated by