This project leverages machine learning techniques to predict the survival of passengers aboard the RMS Titanic, based on various attributes like age, gender, class, and fare. Using Python and key libraries such as NumPy, Pandas, Matplotlib, Seaborn, Scikit-learn, and XGBoost, the study performs a comprehensive analysis to identify significant factors influencing survival rates. The project also compares the performance of three machine learning models: Logistic Regression, Random Forest, and XGBoost, evaluating their accuracy, precision, and recall.
- π Data Analysis: Performed exploratory data analysis (EDA) to understand patterns and correlations in the dataset.
- π οΈ Data Preprocessing: Handled missing values, removed irrelevant fields, and encoded categorical variables for better model performance.
- βοΈ Model Implementation: Built models using Logistic Regression, Random Forest, and XGBoost.
- π Performance Metrics: Evaluated the models based on accuracy, precision, and recall.
- π Insights: Identified significant factors affecting survival, such as gender, class, and age.
- Python
- Libraries: NumPy, Pandas, Matplotlib, Seaborn, Scikit-learn, XGBoost
- Data Source: Kaggle
The project concludes with a comparative analysis of the models used. The results are summarized below:
| Model | Accuracy | Precision | Recall |
|---|---|---|---|
| Logistic Regression | 76.24% | 75.80% | 76.24% |
| Random Forest | 75.40% | 74.50% | 74.80% |
| XGBoost | 77.78% | 78.10% | 75.00% |
- πΊ Gender: Females had a significantly higher survival rate compared to males.
- π« Class: Passengers in first class were more likely to survive due to better access to lifeboats.
- π§ Age: Children were prioritized for evacuation, increasing their survival rate.
- π Use more robust techniques for handling missing data.
- π€ Combine models (e.g., Random Forest for feature selection and XGBoost for final predictions).
- π Apply neural networks for handling larger datasets.