machine-learningpredictive

When should I use logistic regression and KNN for classification?In other words,what are the differences in usages of the two?


I am learning Predictive Modeling and was wondering both Logistic Regression and KNN can be used for classification in case of supervised learning.Then in which cases should we use one or the other?More specifically what are the differences in their applications in case of model building?

Thank You.


Solution

  • Basically, KNN assumes points that are closer to each other must have the same label, it suffers from the curse of dimensionality so I recommend you to use it only with low dimensional data sets with a small number of samples(since is very slow). On the other hand, logistic regression fits a hyperplane that separates two probability distributions from the exponential family, it goes very well on high dimensional data sets with a lot of training points, but if your data is not linearly separable the algorithm won't work at all.