From the course: Python Data Analysis

Unlock the full course today

Join today to access over 24,500 courses taught by industry experts.

Model evaluation and selection

Model evaluation and selection - Python Tutorial

From the course: Python Data Analysis

Model evaluation and selection

- [Narrator] When we analyze data, we often have many different choices in setting up a model, how do we pick the best? Let's resume things where we left them in the last video, with the Gapminder 1985 data and our dataset plotting function, we also add another function to plot the predictions of the models. We consider three different fits, one constant for every region, constants by region plus H5 surviving, and the most complex fit we set up so far, which includes constants by region, H5 survival, group by region, and population. Let's see these three in action. Visually, it looks like the most complex model does best, but we should dig into details. The first thing to do is to compare the residuals. This is how we compute them manually, but we can also get them from the fit object. Histogramming all these residuals together shows that the distribution of errors for the group constant fit is a bit broader, but not by much, and that the other two models are very similar. To distill…

Contents