correct and incorrect predictors
이전 댓글 표시
Dear community members, i am stuck in a problem. I tried to search for the solution but i could not find. I want to get the input data (predictors) of an incorrect predicted class. How can i do that? i am just able to get the incorrect classes in the confusion chart but i need to find the input data of them.
for example lets take this example:
load satdata;
pt = cvpartition(satClass,'holdout',0.3);
predTrain = satData(training(pt),:);
classTrain = satClass(training(pt));
predValid = satData(test(pt),:);
classValid = satClass(test(pt));
knnClassifier = fitcknn(predTrain,classTrain,'Numneighbors',5);
yPred = predict(knnClassifier,predValid);
[c,lbls] = confusionmat(yPred,classValid);
Here i can only see the classes in yPred but i cant see the input data (predictors) of those classes. I hope i am clear to my question.
댓글 수: 3
Walter Roberson
2022년 9월 17일
Unfortunately I cannot tell from here what class(classTrain) is, and so what class(yPred) is.
Saeed Magsi
2022년 9월 17일
Saeed Magsi
2022년 9월 17일
편집: Saeed Magsi
2022년 9월 17일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Nearest Neighbors에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!