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

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 件のコメント

Geethu T H
Geethu T H 2019 年 4 月 9 日
Thank you so much for the quick reply. Can you please explain the working of machine learning techinque you have used in your code. Also is it possible to visualise the catogories?
KSSV
KSSV 2019 年 4 月 9 日
Can you please explain the working of machine learning techinque
YOu have lot of methods in ML.....I have just demonstrated quickly a single one using knnsearch. YOu can read it on your own.
Geethu T H
Geethu T H 2019 年 4 月 9 日
thank you
KSSV
KSSV 2019 年 4 月 9 日
Visualize:
idx = 1:N ;
gscatter(idx,num,C)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

質問済み:

2019 年 4 月 9 日

コメント済み:

2019 年 4 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by