Built to order

Titanic Survival Prediction using Machine Learning

This project predicts Titanic passenger survival from the classic Kaggle dataset — 891 training passengers with 12 raw columns, 38.4% survived. The interesting work is feature engineering: Title extracted from names, FamilySize and IsAlone from SibSp/Parch, deck from Cabin, and a principled missing-value strategy (177 missing ages). A gradient-boosting classifier is tuned with stratified 5-fold cross-validation and evaluated on a held-out test set. A web demo lets you build any passenger profile and see the survival probability with per-factor explanations. Suitable for B.E./B.Tech final-year

Titanic Survival Prediction using Machine Learning — project thumbnail preview
More project photos (2)

The problem

The Titanic dataset is the canonical first classification project, and most student builds waste it: they one-hot encode the raw columns, fit a model, and report an accuracy number nobody can learn from. The dataset rewards the opposite approach — careful feature engineering. Survival was driven by interactions the raw columns hide: class × sex ("women and children first" played out as 74.2% female vs 18.9% male survival), family size (small families beat both solo travellers and very large ones), and title (Master ≈ young boy, a strong survival signal). This project does the engineering properly: Title from names, FamilySize/IsAlone, deck from cabin, title-median age imputation, then a gradient-boosting classifier tuned with stratified cross-validation. The demo makes the model explainable — build a passenger, see the probability, and see exactly which factors moved the odds. Nothing is presented as a measured result before the training run; all metrics are labelled design targets.

How it works

  1. The 891-row training set is loaded; the 418-row test set (labels withheld by Kaggle) is used only for the optional leaderboard submission path.
  2. Features are engineered: Title parsed from Name, FamilySize = SibSp + Parch + 1, IsAlone flag, Deck letter from Cabin, LogFare, one-hot Embarked.
  3. Missing values are handled explicitly: Age by median-per-title, Embarked by mode, Cabin by deck-or-missing indicator.
  4. A gradient-boosting classifier is tuned via stratified 5-fold cross-validation over depth and learning rate.
  5. The best configuration is evaluated once on a held-out 20% test split: accuracy, F1, ROC-AUC and confusion matrix go into the report.
  6. The web demo embeds a simplified scoring function mirroring the engineered feature logic, with per-factor deltas so the prediction is explainable.

Tech stack:

  • Python 3, scikit-learn (GradientBoosting, metrics, CV)
  • NumPy, pandas, Matplotlib
  • Jupyter Notebook (training & evaluation)
  • HTML5 + JavaScript (survival predictor demo)
  • Titanic dataset (Kaggle competition)

Dataset & model details

  • Dataset: Titanic: Machine Learning from Disaster (Kaggle) — 891 training passengers, 12 raw columns (Pclass, Name, Sex, Age, SibSp, Parch, Ticket, Fare, Cabin, Embarked, plus PassengerId/Survived); 342 survived (38.4%). Test set: 418 rows, labels withheld.
  • Task: Binary classification; input = 8 engineered features (Title, FamilySize, IsAlone, Deck, LogFare, Age, Pclass, Sex, Embarked), output = survival probability.
  • Model: Gradient Boosting classifier, hyperparameters tuned with stratified 5-fold cross-validation.
  • Metrics: Accuracy 82.1% (design target), F1 (survived) 0.74 (design target), ROC-AUC 0.87 (design target), confusion matrix on the 179-sample held-out test set. No metric is claimed as measured until the training run is executed for the order.
Parameter Value
Training rows 891 (342 survived, 38.4%)
Raw columns 12 → 8 engineered features
Model Gradient Boosting (design target config)
Test accuracy 82.1% (design target, not a measured claim)
ROC-AUC 0.87 (design target)
Training time Approximately 1–3 min on a laptop CPU (expected)
Demo Single-file web app with explainable scoring
Deliverable model Serialized scikit-learn pipeline (.pkl)

Project features

  • [Real Kaggle Titanic dataset] 891 training passengers, 418 test rows, 38.4% survival — the "Machine Learning from Disaster" competition data.
  • [Proper feature engineering] Title, FamilySize, IsAlone, Deck and LogFare engineered from the raw 12 columns, each justified in the report.
  • [Principled missing-value handling] Age imputed by title-median, Embarked by mode, Cabin converted to deck/missing flag — no silent row-dropping.
  • [Gradient boosting classifier] Handles mixed feature types and the non-linear class × sex interaction without manual interaction terms.
  • [Stratified 5-fold cross-validation] Hyperparameter tuning that respects the small-n variance of 891 rows.
  • [Explainable web demo] Build any passenger profile; get survival probability plus a per-factor contribution list showing what moved the odds.
  • [Full evaluation] Accuracy, F1, ROC-AUC and confusion matrix on a held-out test set, reported once.

What is included

  • Complete training & evaluation Jupyter notebook
  • Trained gradient-boosting pipeline (.pkl) with preprocessing
  • Explainable survival-predictor web demo
  • Confusion matrix, ROC curve and feature-importance plots
  • Project report PDF (feature-engineering rationale, methodology, results)
  • PPT presentation for final review
  • Viva Q&A preparation document (boosting, cross-validation, leakage, imputation)

Limitations & prerequisites

  • 891 rows is small — cross-validation variance is real, and the report discusses it instead of hiding it.
  • The dataset reflects 1912 demographics and a single disaster; it teaches ML method, not anything about modern survival.
  • 82.1% accuracy is a design target, stated honestly — the report documents the actual achieved figures after training.
  • The demo's live scorer is a simplified approximation for illustration; the notebook's trained model is the real deliverable.
  • Kaggle test labels are withheld, so test-set evaluation uses a held-out split of the training data.

Frequently Asked Questions

Why is this more than "fit a model, report accuracy"?

The value is in the feature engineering — Title, FamilySize, deck, title-median imputation — and in the explainable demo. The report justifies every engineered feature with data, which is what a viva actually probes.

Which features matter most?

Sex dominates (74.2% vs 18.9% survival), then Pclass, Fare and Age — the classic "women and children first, and money bought lifeboats" pattern. The importance plot in the report shows this quantitatively.

How are the 177 missing ages handled?

Imputed by the median age of the passenger's title group (Mr/Mrs/Miss/Master/…), which is far more accurate than a global median — documented and justified in the notebook.

What does the demo's "what moved the odds" list mean?

Each factor's contribution to the log-odds score, so you can see e.g. that being female added +2.60 while travelling alone subtracted 0.25. It mirrors the engineered feature logic of the real model.

Can it predict for a real modern ship?

No — and it doesn't claim to. The project is explicit: this is ML method taught on historical data, not a deployable safety model.

Is this project suitable for a final-year project?

Yes — for AI & Machine Learning, Computer Science and IT programs. It demonstrates feature engineering, cross-validation, explainability and honest evaluation on a real dataset. Suitable for B.E./B.Tech final-year projects in AI & Machine Learning, Computer Science and IT.

Components & software requirements
  • Python 3, scikit-learn (GradientBoosting, metrics, CV)
  • NumPy, pandas, Matplotlib
  • Jupyter Notebook (training & evaluation)
  • HTML5 + JavaScript (survival predictor demo)
  • Titanic dataset (Kaggle competition)

Dataset & model details

  • Dataset: Titanic: Machine Learning from Disaster (Kaggle) — 891 training passengers, 12 raw columns (Pclass, Name, Sex, Age, SibSp, Parch, Ticket, Fare, Cabin, Embarked, plus PassengerId/Survived); 342 survived (38.4%). Test set: 418 rows, labels withheld.
  • Task: Binary classification; input = 8 engineered features (Title, FamilySize, IsAlone, Deck, LogFare, Age, Pclass, Sex, Embarked), output = survival probability.
  • Model: Gradient Boosting classifier, hyperparameters tuned with stratified 5-fold cross-validation.
  • Metrics: Accuracy 82.1% (design target), F1 (survived) 0.74 (design target), ROC-AUC 0.87 (design target), confusion matrix on the 179-sample held-out test set. No metric is claimed as measured until the training run is executed for the order.
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download abstract (PDF)

Related guides

All guides
Blueprint-style technical illustration of multiple decision trees voting together into one final predictionStudents with basic Python and pandas skills who want a reliable first classifier for ML coursework and tabular data projects.

Random Forests Explained: Why Decision Trees Vote Better Together

Decision trees are readable but overfit; random forests fix this by training hundreds of varied trees on bootstrapped data with random feature subsets, then letting them vote. This guide explains Gini impurity, bagging, out-of-bag validation and the four hyperparameters that matter, with a complete scikit-learn workflow, honest feature-importance practices, and the mistakes students keep making.

Read guide
Illustration of object tracking showing video frames with bounding boxes and persistent ID labels following people and vehicles, comparing motion prediction and appearance matching.B.E./B.Tech Computer Science and Electronics students building video analytics projects — people counting, vehicle tracking, sports analysis — who have detection working and need

Object Tracking: DeepSORT and ByteTrack Explained

Detection finds objects per frame; tracking keeps their identities across frames. This guide explains tracking-by-detection, Kalman motion models, DeepSORT's appearance embeddings vs ByteTrack's low-confidence box recovery, tracking metrics (HOTA, IDF1, ID switches), and the tuning parameters that determine real-world quality.

Read guide
Illustration of image segmentation showing U-Net's U-shaped encoder-decoder with skip connections producing pixel masks, alongside Mask R-CNN detecting instances with masks.B.E./B.Tech Computer Science and AI/ML students moving from image classification or detection to pixel-level understanding — medical imaging, defect detection, autonomous driving

Image Segmentation: U-Net and Mask R-CNN

When projects need pixel-level answers, segmentation delivers. This guide explains semantic vs instance vs panoptic segmentation, U-Net's encoder-decoder with skip connections, Mask R-CNN's parallel mask head, Dice and IoU evaluation, paired augmentation, and how to choose the right architecture for your data and question.

Read guide
Get a quotation