How to group a data set based on the ranges using machine learning techniques?

조회 수: 1 (최근 30일)
I have one year data of my daily consumption of food.
The sample dataset is given as in the data.xlsx
I want to classify the daily calory into following catogories usning machine learning techning(clustering). Can anybody help me?
Below 10 : Low
10-30 : medium
30- 50 : good diet
50-60 : heavy
more then 60 : bad diet.

채택된 답변

KSSV
KSSV 2019년 4월 9일
Using knnsearch
[num,txt,raw] = xlsread('data.xlsx') ;
N = length(num) ;
C = cell(N,1) ;
C(num<10) = {'Low'} ;
C(num>=10 & num<30) = {'Medium'} ;
C(num>=30 & num<50) = {'Good'} ;
C(num>=50 & num<60) = {'Heavy'} ;
C(num>=60) = {'Bad'} ;
T = table(C,num)
s = input('Enter the Calory value:') ;
idx = knnsearch(num,s) ;
fprintf('The enterd %d calory is %s\n',s,C{idx}) ;
  댓글 수: 4

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Classification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by