Multiple logistic regression

In a similar fashion as with the multiple linear regression, the multiple logistic regression is about using more than one independent variable. Let us try combining the sepal length and the sepal width. Remember that we need to pre-process the data a little bit:

df = iris.query(species == ('setosa', 'versicolor'))
y_1 = pd.Categorical(df['species']).codes
x_n = ['sepal_length', 'sepal_width']
x_1 = df[x_n].values

The boundary decision

Feel free to skip this section and jump to the model implementation if you are not much interested in how we can derive the boundary decision.

From the model, we have the following:

The boundary decision

And from ...

Get Bayesian Analysis with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.