Book Image

Bayesian Analysis with Python

Book Image

Bayesian Analysis with Python

Overview of this book

The purpose of this book is to teach the main concepts of Bayesian data analysis. We will learn how to effectively use PyMC3, a Python library for probabilistic programming, to perform Bayesian parameter estimation, to check models and validate them. This book begins presenting the key concepts of the Bayesian framework and the main advantages of this approach from a practical point of view. Moving on, we will explore the power and flexibility of generalized linear models and how to adapt them to a wide array of problems, including regression and classification. We will also look into mixture models and clustering data, and we will finish with advanced topics like non-parametrics models and Gaussian processes. With the help of Python and PyMC3 you will learn to implement, check and expand Bayesian models to solve data analysis problems.
Table of Contents (15 chapters)
Bayesian Analysis with Python
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Logistic regression


My mother prepares a delicious dish called sopa seca, which is basically a spaghetti-based recipe and which translates literally from Spanish as dry soup. While it may sound like a misnomer or even an oxymoron, the name of the dish makes more sense when we learn how it is cooked. Something similar happens with the logistic regression, a model that despite its name is used to solve classification problems rather than regression ones. The logistic regression model is an extension of the linear regression models we saw in the previous chapter, and thus its name. To understand how we can use a regression model to classify, let us began by rewriting the core of the linear model but this time including a small twist as follows:

Where, f is some function known to us as the inverse link function. Why do we call f the inverse link function instead of just the link function? The reason is that traditionally people thought about these kinds of functions as functions linking the...