Titanic Survival Predictor - Aaryav

Notebook Frontend

Titanic Survival Predictor

Cleaner layout, clearer form flow, and a better read on the model output.

This page sends the same passenger payload to the notebook-backed Flask route, but the interface is now organized around three things: building the record, reviewing the live manifest, and reading the prediction without visual clutter.

Prediction Route

POST /api/titanic/predict

Returns die and survive probabilities from the notebook-trained model.

Notebook Parity

Derived alone + encoded port

The frontend still mirrors the notebook preprocessing flow before the request is sent.

Titanic at sea

Inputs Passed Through

9 fields

Name, class, sex, age, fare, embarkation, family counts, and a derived solo-travel flag.

Design Direction

Less noise

The right rail handles preview and results so the form can stay focused and readable.

Step 1

Build the passenger

Fill in class, age, fare, departure port, and family details in a tighter form layout.

Step 2

Review the manifest

The live summary updates before any API request so you can spot mistakes early.

Step 3

Read the output

The result card separates the survival signal, meter, and optional model weights.

Passenger Builder

Build a boarding record

The form is grouped by identity, ticket details, and travel group so the record reads clearly before submission.

Section 01

Passenger identity

Start with the rider name and the core demographics used by the model.

Section 02

Ticket and departure

These fields influence the economic and embarkation signals passed into the backend.

Prepared for model

The selected port becomes notebook-style encoded columns when the request is assembled.

Section 03

Travel group

The solo-travel signal is derived automatically from these family counts.

Quick Loadouts

Try a starting passenger

These presets fill the form immediately so you can test the model route faster.

Live Manifest

Passenger summary

Solo Traveler

Manifest readout

Avery Dawson boards from Southampton with a second-class ticket and a solo travel profile.

Cabin tier

2nd Class

Party size

1 passenger

Departure port

Southampton

Fare signal

$16.00

Defaults to the local Flask service on localhost:8587 and falls back to the deployed Flask host elsewhere.

Notebook Pipeline

What this page is hosting

Read Notebook

1. Load data

Seaborn Titanic dataset

The notebook starts from the standard Titanic dataset and narrows the columns used for training.

2. Clean inputs

Binary + one-hot preprocessing

Sex and alone become numeric fields, while embarkation is encoded across dedicated feature columns.

3. Predict

Logistic regression via Flask

The page sends the same notebook-shaped payload to /api/titanic/predict and renders the returned probabilities.

Notebook source: _notebooks/CSP/big-ideas/big-idea-2/2025-02-19-pandas-ml_titanic.ipynb

Payload sent: name, pclass, sex, age, sibsp, parch, fare, embarked, and the derived alone value.

Course Timeline