为什么Logistic回归分类器的准确性不同于k近邻?

时间:2019-02-17 23:04:34

标签: logistic-regression knn

我了解如何为每个计算准确性,但我不明白为什么它们会有所不同。

1 个答案:

答案 0 :(得分:0)

First of all, the KNN is a deterministic algorithm, it means if you keep the value of K and run the algorithm n times, the results will be the same.

On the other hand, the logistic regression is a stochastic algorithm. It means the algorithm use some random values to achieve it's goal. If you run the algorithm many times you'll see the results varying. It's normal, although you wanna reduce this variation.

Second, they're different algorithms. It's normal get different accuracies when you apply different algorithms for the same problem. There's no silver bullet in this kind of problem. You need to find the best algorithm that fits in your problem. Sometimes, a algorithm that achieve a very good accuracy in a given problem A is not good for problem B.

I hope it has been helpful.