pythonmachine-learningscikit-learnclassification

What happens if you use LinearRegression with OneVsRestClassifier


I'd like to understand what happens under the hood of scikitlearn OneVsRestClassifier when we use LinearRegression as estimator. Does it create one LinearRegressor per class and apply a softmax function to return an output class? Documentation is not clear in this aspect. Even fit() source code seems is clear enough.


Solution

  • OvR is used for classification not for regression so using LinearRegression would not work at all.

    The one-versus-the-rest(OvR) strategy is used for multiclass classification with multiple binary classifiers. Take the MNIST digit dataset as an example where you would want to create a system that can classify the digit images into 10 classes (from 0 to 9) using OvR you would train 10 binary classifiers, one for each digit (a 0-detector, a 1-detector, a 2- detector, and so on). Then when you want to classify an image, you get the decision score from each classifier for that image and you select the class whose classifier outputs the highest score.