Let’s say the target variable of a dataset is categorical. It may contain one of three values – A, B, and C. Now, machine learning algorithms like logistic regression or Support Vector Machine Classifiers can solve binary classification problems by default. So, we cannot use these algorithms as it is for solving a multiclass classification problem.
So, instead, we can break the multiclass classification problem into several binary classification problems and solve those binary classification problems to predict the outcome of the target variable. One-vs-Rest and One-vs-One are two such classifiers that can be used to solve multiclass classification problems.
What is the One-vs-Rest (OVR) classifier and how does it work?
Let’s look back at our example. Let’s say the target variable of a dataset is categorical and it may take any of the three values – A, B, and C. In the One-vs-Rest (OVR) classifier, the multiclass classification problem is broken into the following binary classification problems:
Problem 1: A vs. (B, C) Problem 2: B vs. (A, C) Problem 3: C vs. (A, B)
Now, the binary classifier can solve each of these binary classification problems and predict the outcome of the target variable.
So, in OVR classification, if the target variable can take n values, the multiclass classification problem is broken into n binary classification problems.
What is the One-vs-One (OVO) classifier and how does it work?
In the One-vs-One classifier, if the target variable can take any of the three values A, B, and C, then the multiclass classification problem is broken into the following problems:
Problem 1: A vs. B Problem 2: A vs. C Problem 3: B vs. C
Now, a binary classifier can solve each of these binary classification problems and predict the outcome of the target variable.
Please note that if the target variable can take any of the n classes, then unlike the OVR classifier, the OVO classifier breaks the multiclass classification problem into n(n-1)/2 binary classification problems.






0 Comments