# bhagwati2316/titanic-passenger-survival-chance-using-deep-learning architecture

> Architecture diagram of the GitHub repository bhagwati2316/titanic-passenger-survival-chance-using-deep-learning, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning
- Repository: https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning

## Overview

This small Streamlit application collects Titanic passenger attributes, encodes categorical fields and scales numeric ones, then runs a pre-trained ANN to produce a survival probability and a threshold-based message. The model and preprocessing encoders are repository artifacts; the app loads them at runtime rather than training them. The sampled app.py shows the full workflow, so no separate service or storage layer is indicated.

Main entry points: [`app.py`](https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/app.py) (Feature Preparation), [`model.h5`](https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/model.h5) (Survival ANN), [`label_encoder.pkl`](https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/label_encoder.pkl) (Sex Encoder), [`onehot_encoder.pkl`](https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/onehot_encoder.pkl) (Embarked Encoder)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_passenger(("Passenger"))
node_inputs["Passenger Inputs<br/>[app.py]"]
node_features["Feature Preparation<br/>[app.py]"]
node_label_encoder["Sex Encoder<br/>[label_encoder.pkl]"]
node_onehot_encoder["Embarked Encoder<br/>[onehot_encoder.pkl]"]
node_scaler["Feature Scaler<br/>[scaler.pkl]"]
node_ann["Survival ANN<br/>[model.h5]"]
node_prediction["Survival Probability<br/>[app.py]"]
node_result["Survival Result<br/>[app.py]"]

node_passenger -->|"enters attributes"| node_inputs
node_inputs -->|"builds dataframe"| node_features
node_features -->|"encodes sex"| node_label_encoder
node_features -->|"encodes port"| node_onehot_encoder
node_features -->|"scales fields"| node_scaler
node_features -->|"predicts from features"| node_ann
node_ann -->|"returns probability"| node_prediction
node_prediction -->|"thresholds and displays"| node_result

click node_inputs "https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/app.py"
click node_features "https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/app.py"
click node_label_encoder "https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/label_encoder.pkl"
click node_onehot_encoder "https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/onehot_encoder.pkl"
click node_scaler "https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/scaler.pkl"
click node_ann "https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/model.h5"
click node_prediction "https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/app.py"
click node_result "https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/app.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_passenger toneIndigo
class node_inputs,node_features,node_label_encoder,node_onehot_encoder,node_scaler,node_ann,node_prediction,node_result toneTeal
```

## Components

### Other components

- **Passenger**
- [Passenger Inputs](https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/app.py): `app.py`
- [Feature Preparation](https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/app.py): `app.py`
- [Sex Encoder](https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/label_encoder.pkl): `label_encoder.pkl`
- [Embarked Encoder](https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/onehot_encoder.pkl): `onehot_encoder.pkl`
- [Feature Scaler](https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/scaler.pkl): `scaler.pkl`
- [Survival ANN](https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/model.h5): `model.h5`
- [Survival Probability](https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/app.py): `app.py`
- [Survival Result](https://github.com/bhagwati2316/titanic-passenger-survival-chance-using-deep-learning/blob/main/app.py): `app.py`

## Connections

- Passenger → Passenger Inputs: enters attributes (evidence: `app.py`)
- Passenger Inputs → Feature Preparation: builds dataframe (evidence: `app.py`)
- Feature Preparation → Sex Encoder: encodes sex (evidence: `app.py`)
- Feature Preparation → Embarked Encoder: encodes port (evidence: `app.py`)
- Feature Preparation → Feature Scaler: scales fields (evidence: `app.py`)
- Feature Preparation → Survival ANN: predicts from features (evidence: `app.py`)
- Survival ANN → Survival Probability: returns probability (evidence: `app.py`)
- Survival Probability → Survival Result: thresholds and displays (evidence: `app.py`)
