1. Introduction
The sinking of the Titanic in 1912 stays one of the vital well-known maritime disasters in historical past. With over 1,500 casualties, a number of elements influenced a passenger’s likelihood of survival, together with ticket class, gender, and age. On this article, we analyze the Titanic passenger knowledge and use Machine Studying fashions to foretell who had a better probability of survival.
2. Analysis Questions and Targets
Analysis Questions: What elements influenced the survival of Titanic passengers, and the way can Machine Studying fashions predict their survival probabilities?
Targets:
1. Discover the Titanic dataset to grasp survival patterns.
2. Construct predictive fashions utilizing totally different Machine Studying strategies.
3. Analyze mannequin outcomes and consider their accuracy.
3. Knowledge Exploration
The Titanic dataset from Kaggle consists of 891 coaching knowledge factors with options comparable to:
- Pclass: Passenger ticket class (1 = first-class, 3 = third class)
- Intercourse: Gender
- Age: Passenger age
- SibSp & Parch: Variety of relations aboard
- Fare: Ticket value
- Embarked: Port of embarkation
Knowledge Visualization
- Survival Distribution by Gender
Evaluation exhibits that girls had a considerably increased survival charge in comparison with males.
2. Survival Distribution by Ticket Class
First-class passengers had a better survival charge than these in decrease lessons.
3. Survival Distribution by Age
Youngsters had a better chance of survival in comparison with adults.
4. Machine Studying Modeling
To foretell survival, we used two Machine Studying fashions:
1. Choice Tree with an accuracy of 80.4%
2. Random Forest with an accuracy of 81.6% (best-performing mannequin)
Mannequin Analysis
Confusion Matrix for Random Forest
Based mostly on the analysis:
- Precision for the “Survived” class: 78.9%
- Recall for the “Survived” class: 75.7
- Total accuracy: 81.6%
5. Conclusion
From the evaluation, the important thing elements influencing survival had been:
- Gender — Girls had a better likelihood of survival.
- Ticket Class — First-class passengers had been extra more likely to survive.
- Age — Youngsters had a better survival chance than adults.
The Random Forest mannequin offered the perfect accuracy for survival prediction. This examine demonstrates that Machine Studying can be utilized to investigate historic catastrophe patterns and supply deeper insights.