Titanic Survival Predictor Web App

A fun and interactive web application that predicts whether you would have survived the Titanic disaster based on your passenger profile. Built with Flask and machine learning using an optimized Random Forest model.

Python
Flask
Scikit-learn
Pandas
Bootstrap
Chart.js
NumPy
Titanic Survival Predictor Dashboard

The Challenge

The Titanic disaster remains one of history's most studied maritime tragedies, revealing fascinating patterns about social inequality and survival. The challenge was to create an engaging web application that not only predicts survival chances using machine learning but also educates users about the historical context and social patterns that emerged from this tragic event.

Technical Approach

Data Processing

Cleaned and preprocessed the Titanic dataset, handling missing values and feature engineering for optimal model performance using Pandas and NumPy.

Model Training

Implemented Random Forest Classifier with optimized hyperparameters, achieving a Kaggle score of 0.77751 with 100 trees and max depth of 5.

Web Interface

Built an interactive Flask application with Bootstrap UI, Chart.js visualizations, and real-time predictions with probability scores.

Key Features

Interactive Form

Easy-to-use form to input passenger details including class, gender, age, fare, family size, and port of embarkation for personalized survival predictions.

Real-time Predictions

Get instant survival predictions with probability scores and detailed breakdowns showing how different factors influenced the outcome.

Beautiful UI

Modern, responsive design with Bootstrap and custom CSS featuring gradient backgrounds, animations, and mobile-friendly interface.

Historical Context

Learn about survival patterns from the actual Titanic data with interactive charts showing survival rates by demographics and social factors.

Probability Visualization

Interactive Chart.js visualizations showing survival chances and feature importance, making complex data accessible and engaging.

Results & Impact

0.77751

Kaggle competition score using Random Forest Classification

100 Trees

Optimized Random Forest model with max depth of 5

Live Demo

Successfully deployed on Railway with full functionality

The application successfully combines machine learning with historical education, achieving a solid Kaggle score while making complex data science concepts accessible to the general public. The project reveals fascinating patterns from the Titanic disaster, including the "women and children first" policy (74% of women survived vs 19% of men) and class disparities (1st class: 63%, 2nd class: 47%, 3rd class: 24% survival rates).

Lessons Learned

Educational Value of Historical Data

Combining machine learning with historical context creates powerful educational tools. The Titanic data reveals important social patterns that make the technical aspects more engaging and meaningful.

Model Interpretability Matters

Random Forest's interpretability was crucial for this educational application. Users could understand how different factors influenced survival, making the AI more transparent and trustworthy.

Web Development Meets Data Science

Flask provided the perfect framework for combining machine learning with web development. The combination of backend processing and frontend visualization created an engaging user experience.