This project performs a comprehensive analysis of the Titanic dataset to understand the factors that influenced passenger survival.
The Titanic dataset contains information about 891 passengers who were on board the Titanic when it sank, including their demographics, ticket information, and survival outcomes. This analysis explores the data to identify key attributes that affected survival rates.
- Records: 891 passengers
- Data Types: Continuous numerical, discrete numerical, and categorical data
- Target Variable: Survived (categorical)
The dataset includes the following attributes:
- PassengerId: Unique identifier for each passenger
- Survived: Survival outcome (0 = No, 1 = Yes)
- Pclass: Passenger class (1, 2, or 3)
- Name: Passenger name
- Sex: Passenger gender
- Age: Passenger age
- SibSp: Number of siblings/spouses aboard
- Parch: Number of parents/children aboard
- Ticket: Ticket number
- Fare: Ticket fare price
- Cabin: Cabin number
- Embarked: Port of embarkation
- Data Exploration: Understanding dataset structure, data types, and basic statistics
- Data Visualization: Bar charts for all categorical columns to visualize distributions
- Feature Correlation: Correlation matrix and heatmap to identify relationships between numerical features
- Missing Value Analysis: Identification and handling of missing values in Age (177 missing) and Cabin (687 missing) columns
- Data Preprocessing: Outlier removal from Fare column using the IQR (Interquartile Range) method
- Feature Selection: Univariate feature selection using mutual information to identify the top 5 attributes affecting survival
The feature selection analysis identified the following attributes as most influential for survival prediction:
- Survived (target variable)
- Fare
- Sex (male)
- Pclass
- SibSp
- Age
- Parch
- Python
- Pandas (data manipulation)
- Matplotlib (data visualization)
- Seaborn (statistical visualization)
- Scikit-learn (feature selection)
See pyproject.toml for project dependencies.