Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sklearn: Difference between using OneVsRestClassifier and build each classifier individually

As far as I know, multi-label problem can be solved with one-vs-all scheme, for which Scikit-learn implements OneVsRestClassifier as a wrapper on classifier such as svm.SVC. I am wondering how would it be different if I literally train, say we have a multi-label problem with n classes, n individual binary classifiers for each label and thereby evaluate them separately.

I know it is like a "manual" way of implementing one-vs-all rather than using the wrapper, but are two ways actually different? If so, how are they different, like in execution time or performance of classifier(s)?

like image 852
Francis Avatar asked Sep 27 '22 07:09

Francis


People also ask

How will you differentiate between a multi-class and multi-label classification problem?

Difference between multi-class classification & multi-label classification is that in multi-class problems the classes are mutually exclusive, whereas for multi-label problems each label represents a different classification task, but the tasks are somehow related.

Which one is better is one-vs-Rest and one-vs-one?

Although the one-vs-rest approach cannot handle multiple datasets, it trains less number of classifiers, making it a faster option and often preferred. On the other hand, the one-vs-one approach is less prone to creating an imbalance in the dataset due to dominance in specific classes.

What is the one vs all approach of solving the multi-class logistic regression?

One-vs-rest (OvR for short, also referred to as One-vs-All or OvA) is a heuristic method for using binary classification algorithms for multi-class classification. It involves splitting the multi-class dataset into multiple binary classification problems.

How many binary classifier models are required in one-vs-one multiclass classification technique if there are N class instances?

In One-vs-One classification, for the N-class instances dataset, we have to generate the N* (N-1)/2 binary classifier models. Using this classification approach, we split the primary dataset into one dataset for each class opposite to every other class.


1 Answers

There would be no difference. For multi-label classification, sklearn one-versus-rest implements binary relevance which is what you have described.

like image 167
Arnaud Joly Avatar answered Oct 05 '22 06:10

Arnaud Joly