kNN classification error on numeric data
Show older comments
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{:});
Answers (0)
Categories
Find more on Nearest Neighbors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!