Will you survive the Titanic?

Photo by Mishal Ibrahim on Unsplash

Introduction

First i will try to answer 3 questions i am interested in then by using the magic of ML i will see if i will survive. Don’t worry i will link to a github repository so you can see for yourself if you will survive or not.

Link to the data set: https://www.kaggle.com/c/titanic

Link to the repository: https://github.com/FancyWhale69/titanic_dataset_analysis

part I: which gender survive more?

Survival count based on gender

That was quick!! a simple count plot reveled to us that yes gender does play a role. If you are a man then you have a 52%(men) chance V.S 9%(women) chance of meeting jack at the bottom.

part II: does class affect survival rate?

survival count based on ticket class

Will you look at that, maybe it is worth it to spend some extra dough for that ticket upgrade. That’s interesting but we know that gender plays a huge role in survival, let’s see if it has role here too?

survival count based on gender and ticket class. 1= survived, 0=dead.

Sorry for the ugly graph seaborn was not cooperating with me. Looks like gender still plays a role, death rate among men for 1st and 2nd class are almost identical while survival rate for 1st class women are higher than other classes.

The highest death rate for women can be observed in the 2nd class, looks like ticket class still plays a role but not for men.

part III: does having parents/children affect survival rate?

survival count based on number of parents/children and gender. 1= survived, 0=dead.

To be honest i thought there will be hope for men since if they a child or a parent they need to stay with them which leads to riding the boat.

At this point it seems like surviving the titanic as a man is either pure luck or there is some hidden factor i couldn’t find.

part IV: Let’s see if we will survive

filling needed info for the prediction

Drum rolls.

prediction result

Better prepare some cards to play with jack.

Conclusion

if you are a women, then most likely you will survive, being in a higher class only benefit you if you are a women, having parents/children doesn’t help you as a man.

On the brighter side if you are a man you won’t live to see WWI and WWII.