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 lead them to pursue extra-marital 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 many that we believe might be the most important factors that might lead someone to pursue an affair.
First let's read in the data:
# Using dataset of a 1978 survey conducted to measure likliehood 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...