Knn regression in Matlab

穿精又带淫゛_ 提交于 2020-01-03 16:57:43

问题


What is the k nearest neighbour regression function in Matlab? Is only knn classification function available? Is anybody knowing any useful literature regarding to that?

Regards

Farideh


回答1:


I don't believe the k-NN regression algorithm is directly implemented in matlab, but if you do some googling you can find some valid implementations. The algorithm is fairly simple though.

  1. Find the k-Nearest elements using whatever distance metric is suitable.
  2. Convert the inverse distance weight of each of the k elements
  3. Compute weighted mean of the k elements using the inverse distance weight.


来源:https://stackoverflow.com/questions/19807294/knn-regression-in-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!