How to use KNN to classify data in MATLAB

조회 수: 2 (최근 30일)
khusnul azima
khusnul azima 2018년 7월 28일
댓글: Image Analyst 2018년 8월 1일
I'm having trouble understanding how the K-NN classification works in MATLAB. 'Here's the problem, I have a large dataset 30 out of 90 subjects.
form a dataset like this:
359.872,317.948, Under-ripe
316.988,257.132, ripe
346.748,30.782, Over-ripe
I once tried and the result: Error using load Unknown text on line number 1 of ASCII file aa.txt
In short, I want to - divide the data into 3 groups - "train" KNN and want to know validation.
I hope you can help me, thank you in advance
  댓글 수: 3
khusnul azima
khusnul azima 2018년 8월 1일
i have tried some load function to import data but data will not appear in the form of matrices and strings.
an example of a tested load
1.fileID = fopen('tes.txt');
2.A=load('tes.txt')
3.dlmread
My file consist in columns like this :
value      value     string
359.87  317.948   Under-ripe
Image Analyst
Image Analyst 2018년 8월 1일
Unfortunately you forgot to attach 'tes.txt'. I'll check back later.

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2018년 7월 28일
See attached demo.
  댓글 수: 1
khusnul azima
khusnul azima 2018년 8월 1일
how to enter data/read data in the form of matrix and string in one execution.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by