user27379
user27379

Reputation: 47

Knn regression in Matlab

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

Upvotes: 4

Views: 3495

Answers (1)

aplassard
aplassard

Reputation: 759

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.

Upvotes: 4

Related Questions