Let's examine two additional variables that could significantly impact our predictive model. We'll start by analyzing survival rates through the lens of gender, a factor that historically played a crucial role in maritime disaster protocols. To visualize this relationship, we'll execute xs = sns.countplot where our X parameter is survived, our hue is sex, and our data remains the Titanic dataset.

The resulting visualization reveals a stark disparity in Titanic survival by gender. Male passengers perished at a dramatically higher rate, while female passengers demonstrated significantly better survival outcomes overall. This pattern aligns with the "women and children first" maritime protocol that was standard practice during the early 20th century, making gender a potentially powerful predictor in our model.

Building on this analysis, we'll investigate another demographic factor: the port of embarkation. This variable captures which port passengers boarded the Titanic, potentially reflecting socioeconomic patterns, cabin locations, or regional cultural factors that influenced survival outcomes. We'll apply the same visualization approach to uncover these patterns.

Using the same countplot methodology—where X is survived, hue is embarked, and our data source remains the Titanic dataset—we can examine survival rates across the three departure ports. The results reveal compelling differences: passengers embarking from Southampton (S) faced approximately a two-thirds mortality rate, those from Queenstown (Q) experienced a 60-70% death rate, while passengers from Cherbourg (C) actually had higher survival rates than death rates. These variations likely reflect the socioeconomic stratification of passengers from different ports, with Cherbourg passengers potentially occupying higher-class accommodations that provided better access to lifeboats.

These demographic and geographic factors demonstrate clear predictive potential for our survival model. In our next analysis, we'll explore advanced techniques for combining these variables to create more sophisticated predictive insights that capture the complex interplay between multiple risk factors.