Exploring regression modeling
You have already used regression models in Chapter 9 and Chapter 10. Here, we will go deeper into regression modeling and compare linear and non-linear models for data modeling. A famous early example of regression analysis was produced by Sir Francis Galton, who lived in England from 1822 to 1911. Among many activities, Galton collected data on the heights of fathers and mothers and their adult children. It is notable that today, the data would be considered biased, as the sample was most likely from more affluent families that had access to better nutrition and living conditions than the average for the time in England. Nonetheless, the data serves as a good introduction to regression:
- Here, we load a simplified version of the data (adapted from the original) into a pandas DataFrame and plot the heights of all the children and the fathers:
galton_heights = pd.read_csv('Datasets/galton.csv') galton_heights.head()
This produces...