Case study 2 – Why do some people cheat on their spouses?
In 1978, a survey was conducted on housewives in order to discern factors that led them to pursue extramarital affairs. This study became the basis for many future studies of both men and women, all attempting to focus on features of people and marriages that led either partner to seek partners elsewhere behind their spouse's back.
Supervised learning is not always about prediction. In this case study, we will purely attempt to identify a few factors of the many that we believe might be the most important factors that lead someone to pursue an affair.
First, let's read in the data:
# Using dataset of a 1978 survey conducted to measure likelihood of women to perform extramarital affairs # http://statsmodels.sourceforge.net/stable/datasets/generated/fair.html import statsmodels.api as sm affairs_df = sm.datasets.fair.load_pandas().data affairs_df.head()
The statsmodels
website provides a data dictionary, as follows...