Hacker News new | ask | show | jobs
by brookhaven_dude 2687 days ago
He mentioned that he applied knn to handwritten digit recognition. A likely approach would be as follows.

Given a new vector that needs to be classified (say, x), it is compared with its nearest neighbors in the data set (let's call them x_1, x_2, x_3,..,x_k). A weighted average of the categories of the nearest neighbors is calculated to classify x.

That is to say, the category y that x belongs to is given by some function of categories of the nearest neighbor (e.g. weighted sum)

y = f(w_1y_1 + .... + w_ky_k)

where f() is a function that converts the continuous weighted sum to one of the integers representing the categories, and y_1,...,y_k are categories that x_1,...,x_k belong to, respectively.

The weights w_1,....,w_k can be determined by optimizing some error function.