Logistic regression vs clustering analysis I am having some trouble understanding the difference between clustering and logistic regression. Can you give me some examples of when and why it would be better to use clustering instead of logistic regression and vice versa?
 A: Succinctly,

*

*Logistic regression is a supervised learning task.  If you have inputs and a binary outcome then you can use logistic regression.  For example, let's say I want to know the probability of a plant dying using the mass of herbicide I use as my predictor.  The outcome is did the plant die (yes or no, hence binary) and the predictor would be the mass of the herbicide.


*Clustering is an unsupervised learning task.  If all you have is data and no outcomes, clustering is one way to find observations which are similar to one another in some sense.  For example, let's say I have behaviour data for customers of some store.  I have how frequently they come to the store, how much money they spend, the proportion of time they spend in each part of the store, etc etc.  I can use clustering to make claims like "Customer X and Y behave similarly (because my algorithm puts them in the same cluster), but Customer Z is not similar to either Customer X or Customer Y because Customer Z is in a different cluster."
