O'Reilly logo

Effective Amazon Machine Learning by Alexis Perrier

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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; 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required