Classification 3(Multi class)

Posted by JongHyun on September 26, 2017

In the classification, there are binary class classification and multi class classification. I already dealt with binary calss classfication before. Now let's talk about multi class classification. Simply, multi class classification is used when there are discrete output and the number of output is larger than 2. Multi class classification can be found easily in the world. For example, email-folding / tagging, medical diagram, wether forecasting and so on. The simplest multi class case would be 3 class case like below plot.

classification_example

We can see there are 3 main part which can be divided into each similar region. Then, our queation would be how we can divide them into 3 region or find decision boundary based on our knowledge of binary class. The answer is "Yes". We can use the similar method to multi class classification. The name of method is one-vs-all. It trains a logistic regression classifier(hypothesis) for each class to predict the probability. If we get new input after training, we can make prediction by picking the class that maximize hypothesis. $$h_\theta^{(i)}(x)=P(y=i|x;\theta)\text{ i : each class}$$ $$\text{With new input x, choose }\;\max_{\rm i} h_\theta^{(i)}(x)$$