This repository contains an exploratory data analysis (EDA) of the Titanic dataset, which is one of the most popular datasets used for data science and machine learning. The Titanic dataset provides information on the fate of passengers on the Titanic, summarized according to economic status (class), sex, age, and survival.
In this project, we perform comprehensive data cleaning, explore the relationship between different variables, identify patterns, and detect trends. We delve into the data to uncover insights that could give us a better understanding of the factors that contributed to the survival or demise of the passengers aboard the ill-fated voyage.
We begin by cleaning our dataset to ensure accuracy in our analysis. The data cleaning steps involved:
- Addressing missing values
- Converting data types for analysis
- Removing irrelevant features
Our EDA consists of several key components:
- Summary statistics to understand the data's central tendency, dispersion, and shape
- Distribution analysis of key features such as age and fare
- Survival rate comparisons across different passenger classes
We use a variety of visualizations to illustrate our findings:
- Bar charts to compare the number of survivors among passenger classes
- Histograms to explore the age distribution of passengers
- Heatmaps to reveal correlations between numerical features
To explore the data further, we employ statistical tests:
- T-tests to compare the ages of survivors versus non-survivors
- Chi-square tests to assess independence between categorical variables
We generate a correlation matrix to identify and visualize correlations between different numerical features, which helps in understanding the relationships between variables and survival rates.
- Passenger class had a significant impact on survival rates.
- There was a higher survival rate for women compared to men, indicating a 'women and children first' policy in the lifeboats.
- Younger passengers had a higher survival rate compared to older ones.
TitanicEDA.ipynb
: Jupyter notebook containing the full analysis, including data cleaning, exploratory data analysis, and visualization.
The analysis of the Titanic dataset sheds light on the tragic event and provides valuable lessons about the social norms of the time, which ultimately influenced the survival of individuals. These findings could be utilized further to predict survival outcomes and to analyze similar events in history.