use kmeans to split database of flowers

10 ビュー (過去 30 日間)
taly
taly 2013 年 8 月 21 日
Hi, My project is about flower recognition using matlab. I have database of 100 flower of 11 types. The purpose of the project is to get as input one of the flowers and print the name and features of the flower.
I already extract 4 features of the flowers( rgb colors, number of petals and etc.) Now I want to use 'kmeans' in order to devide the flowers into 11 clusters, when each type will be assign to one of the clusters. Does kmeans has option that will let me choose 11 of the flowers as seeds which will build the clusters? Or mayby you know about anoher function which will let me insert the flowers into 11 clusters manualy?
Thanks (^_^)

採用された回答

Shashank Prasanna
Shashank Prasanna 2013 年 8 月 21 日
編集済み: Shashank Prasanna 2013 年 8 月 21 日
You can specify your 'seed' as start point for KMEANS:
[idx,ctrs] = kmeans(X,11,'start',seedmat)
X is your matrix of 100 rows and 4 columns (based on your description)
seedmat is a matrix of your 11x4 seeds centroids which is where KMEANS will start to search.

その他の回答 (1 件)

taly
taly 2013 年 8 月 21 日
thank you very much Shashank.
I have one more question: how can I compare the subject flower, that will be described by 1X4 array (that contains his features), to the clusters that k-means made?
  4 件のコメント
Shashank Prasanna
Shashank Prasanna 2013 年 8 月 21 日
check the distance from each your new flower to the centroids and pick the minimum distance.
taly
taly 2013 年 8 月 23 日
That is a great way. Thank you very much (^_^)

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

カテゴリ

Help Center および File ExchangeStatistics 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