Calculating family size

Finally, it makes sense to assume that the overall family size a passenger belongs to might have been a decisive factor in survival. We can aggregate the number of siblings and the number of parents and add 1 for the passenger. The following simple query will create the family size variable:

select sibps + parch + 1 as family_size from titanic; 

Get Effective Amazon Machine Learning now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.