Search code examples
machine-learningscikit-learnmulticlass-classification

What is the default mechanism used by scikit-learn algorithms for multiclass classification?


I am using scikit-learn to build a multiclass classification model. To this extent, I have tried the RandomForestClassifier, KNeighborsClassifier, LogisticRegression, MultinomialNB, and SVC algorithms. I am satisfied with the generated output. However, I do have a question about the default mechanism used by the algorithms for multiclass classification. I read that all scikit-learn classifiers are capable of multiclass classification, but I could not find any information about the default mechanism used by the algorithms.


Solution

  • One-vs-the-rest or One-vs-all is the most commonly used and a fair default strategy for multiclass classification algorithms. For each classifier, the class is fitted against all the other classes. Check here for more information https://scikit-learn.org/stable/modules/generated/sklearn.multiclass.OneVsRestClassifier.html