Decision Boundaries of Multinomial and One-vs-Rest Logistic Regression
This example compares decision boundaries of multinomial and one-vs-rest logistic regression on a 2D dataset with three classes.
We make a comparison of the decision boundaries of both methods that is equivalent
to call the method predict. In addition, we plot the hyperplanes that correspond to
the line when the probability estimate for a class is of 0.5.
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
Dataset Generation
We generate a synthetic dataset using the make_blobs
function. The dataset consists of 1,000 samples from three different classes,
centered around [-5, 0], [0, 1.5], and [5, -1]. After generation, we apply a linear
transformation to introduce some correlation between the features to make the problem
more challenging. This results in a 2D dataset with three overlapping classes,
suitable for demonstrating the differences between multinomial and one-vs-rest
logistic regression.


