classification experiments with the k-Nearest Neighbor algorithm.

1 回表示 (過去 30 日間)
Husky
Husky 2013 年 2 月 5 日
Hi everyone
It's my first effort for KNN classification and am using wine data sample from UCI website. i was wondering what distance measures I can use in this case and how to get the computation time required to compute the distance from a sample to each other sample.
I want to determine its k nearest neighbors for each labeled sample, if the label of the sample is more common than any other label for the k nearest neighbors, then count the classification as correct. Otherwise, count the classification as incorrect.
I'd appreciate any input
Thanks
data set info: attributes :
1) Alcohol
2) Malic acid
3) Ash
4) Alcalinity of ash
and ... 13)xxx
it categorizes wines into 3 classes
one example would be:
1,14.23,1.71,2.43,15.6,127,2.8,3.06,.28,2.29,5.64,1.04,3.92,1065
  2 件のコメント
Walter Roberson
Walter Roberson 2013 年 2 月 5 日
Measuring computation time is difficult to do right, especially if what you are trying to do is predict how efficient different methods would be with larger datasets.
Husky
Husky 2013 年 2 月 5 日
Thanks walter, this dataset is small, only 178 lines each having 13 attributes

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

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 2 月 5 日
For timing, see the File Exchange Contribution timeit
  1 件のコメント
Husky
Husky 2013 年 2 月 5 日
Thanks but how exactly should I use this function in KNN code?

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

Community Treasure Hunt

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

Start Hunting!

Translated by