kNN classification error on numeric data

I'm trying to use kNN classification on a dataset with following data structure:
-39.687 38.54 -3.1409 -1.611 -3.1381 'bear'
I'm getting the following error
>> y = fitcknn(ds,'category');
Error using classreg.learning.FullClassificationRegressionModel.prepareDataCR (line 129)
X must be a numeric matrix.
Error in classreg.learning.classif.FullClassificationModel.prepareData (line 455)
[X,Y,W,dataSummary] = ...
Error in classreg.learning.FitTemplate/fit (line 205)
[X,Y,dataPrepOut{1:this.NDataPrepOut}] = ...
Error in ClassificationKNN.fit (line 842)
this = fit(temp,X,Y);
Error in fitcknn (line 267)
this = ClassificationKNN.fit(X,Y,varargin{:});

답변 (0개)

질문:

2018년 2월 15일

편집:

2018년 2월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by