Session Ready
Exercise

Build better models

Earlier you built a collection of simple models to fit life expectancy using the year feature. Your previous analysis showed that some of these models didn't fit very well.

In this exercise you will build multiple regression models for each country using all available features. You may be interested in comparing the performance of the four worst fitting models so their adjusted \(R^2\) are provided below:

Country Adjusted \(R^2\)
Botswana -0.0060772
Lesotho -0.0169851
Zambia 0.1668999
Zimbabwe 0.2083979
Instructions
100 XP
  • Build a linear model for each country predicting life_expectancy using every feature in the dataset.
  • Append a column (fit) containing fit statistics for each model and simplify this dataframe.
  • Print the adjusted \(R^2\) in fullmodel_perf of the four countries from worst_fit dataframe.