• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

amoudgl/kNN-classifier: kNN classifier built in MATLAB.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

amoudgl/kNN-classifier

开源软件地址(OpenSource Url):

https://github.com/amoudgl/kNN-classifier

开源编程语言(OpenSource Language):

MATLAB 100.0%

开源软件介绍(OpenSource Introduction):

kNN-Classifier

kNN classifier built in MATLAB. It is tested on five datasets:

  • Iris
  • Wine
  • Banknote Authentication
  • Ionosphere
  • Magic Gamma Telescope

Datasets are taken from UCI Machine Learning Repository.

Structure of repository

Repository contains five folders for each dataset. Each folder further contains two files:

  • Main index file 'main.m'
  • KNN Classifier function 'knnclassifier.m'

Accuracy plots are also included in the folder of each dataset.

Implementation

First data is stored and divided into y​equal parts (y​­​fold). One part is declared as test data and rest is training data. This completes the training phase. During test phase, a test sample is picked and all the training samples are sorted according to normal or (weighted) euclidean distance from test sample. For first k​data points (in sorted list) polling is done. The class with maximum frequency is allotted to test data sample. Same procedure is repeated for all the test data points. For a particular dataset, k is varied from 1 to 5 and y is varied from 2 to 5.

Tie break: It may happen when k is even. Two classes may have same frequency during polling. In this case, sum of distances for both the classes is calculated. Class with minimum sum is allotted to test data sample.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap