I'm a bit confused with the usage of logistic regression for multi-class classification. My understanding is that a logistic regression is dichotomous (two possible classes), so in the example of the Iris sepal/petal there are 3 Species:
1. *setosa*,
2. *versicolor* and
3. *virginca*
If we run a logistic regression on the Iris dataset, how can it distinguish between the 3 species?
code example:
model = LogisticRegression()
model.fit(x_train, y_train)
predictions = model.predict(x_test)
results in:
array(['versicolor', 'setosa', 'virginica', 'versicolor', 'versicolor',
'setosa', 'versicolor', 'virginica', 'versicolor', 'versicolor',
'virginica', 'setosa', 'setosa', 'setosa', 'setosa', 'versicolor',
'virginica', 'versicolor', 'versicolor', 'virginica', 'setosa',
'virginica', 'setosa', 'virginica', 'virginica', 'virginica',
'virginica', 'virginica', 'setosa', 'setosa'], dtype=object)