1
$\begingroup$

considered KNN, it seems that a machine learning algorithm does not have to have weights, a training process, loss function or optimization, so, what is the common ingredients of a machine learning algorithm?

it seems that what a machine learning algorithm does have to have includes a training set, prediction functionality, distance metric, what else?

A lot of machine learning books/tutorials use KNN as the 1st example of supervised machine learning without telling the keys we can get from KNN, So, I am trying to figure it out.

$\endgroup$
0
$\begingroup$

You might want to check the definition of "supervised" & "unsupervised" statistical (machine) learning. And most importantly check & understand the methods you want to apply. I wouldn't generalize "machine learning algorithm".

For your example. KNN is an extremely simple nonparametric method. It doesn't have to be trained. There is no parameter!. It just checks the k-nearest neighbor.

You clearly have to find the best "k" though. So you can test different k, calculate e.g. RSS and chose the best k. Guess you can define that as a loss-function :-)

$\endgroup$
  • $\begingroup$ I would argue that a KNN classifier definitely has parameters, in fact an unbounded number: it needs to save all of its training data. $\endgroup$ – Mees de Vries Aug 3 '19 at 8:44
  • $\begingroup$ Does the training change "saving the training data"? The data is known, hence not a parameter to be estimated. I would argue that this is just required to run KNN. But there is no training involved but computational resources. It is nonparametric per definition I would say. The only unknown hyperparameter is k. And finding a reasonable one is described above. $\endgroup$ – Clemens Haerder Aug 3 '19 at 8:55
  • $\begingroup$ Thanks for your answer. In the context of supervised machine learning, What do KNN and other supervised machine learning algorithms both have in common? $\endgroup$ – fu DL Aug 3 '19 at 11:45
  • $\begingroup$ I would say the task :-). Classification or regression (categorical or numerical response). For KNN it doesnt make sense to split your data in a training, test, validation set as it just decreases the performance. As said, there is no training required as kNN is nonparametric. But I am not sure if this answer helps, or if there is a good answer to that question... $\endgroup$ – Clemens Haerder Aug 4 '19 at 7:51
  • $\begingroup$ Your answer is very helpful. A lot of machine learning books/tutorials use KNN as the 1st example of supervised machine learning without telling the keys we can get from KNN, So, I am trying to figure it out. $\endgroup$ – fu DL Aug 5 '19 at 8:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.