No, logistic regression cannot be used for classes more than 2 as it is a binary classifier. For multi-class classification algorithms like Decision Trees, Naïve Bayes’ Classifiers are better suited.
Yes, logistic regression can be used for classes more than two, but it is typically used for binary classification problems where the outcome variable has two classes. When dealing with more than two classes, you can use a variant of logistic regression called “multinomial logistic regression” or “softmax regression.”
In multinomial logistic regression, the model is extended to handle more than two classes by using the softmax function. The softmax function assigns probabilities to each class and ensures that the sum of these probabilities across all classes is equal to 1.
So, in summary:
- Logistic regression: Binary classification (two classes).
- Multinomial logistic regression (or softmax regression): Multiclass classification (more than two classes).