Logistic Regression on multiple classes (Shouldn't it be only on binary?) 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)


Extending my comment into an answer:
There are several natural extensions to handle multiple classes, and two are built into scikit-learn. Multinomial logistic regression is still logistic regression. And one-versus-rest classification is another common way to extend a binary classifier to multiple classes.
See the scikit-learn LogisticRegression documentation for how multi-class prediction is handled in the software you’re using.

In the multiclass case, the training algorithm uses the one-vs-rest (OvR) scheme if the ‘multi_class’ option is set to ‘ovr’, and uses the cross-entropy loss if the ‘multi_class’ option is set to ‘multinomial’.

