Serving pipeline

What this page is actually running

API contract

The endpoint accepts `Age`, `Fare`, `SibSp`, `Parch`, `Pclass`, `Embarked`, and `Sex` validates allowed categorical values, converts numeric fields, and builds a single-row pandas DataFrame for inference.

Feature transformation

`Sex` is treated as binary feature. `Embarked` is one-hot encoded into `Embarked_C`, `Embarked_Q`, and `Embarked_S`. The resulting features are ordered for further processing.

Inference output

The 9-feature vector is cast to `float32`, transformed with the saved `StandardScaler`, passed to the trained PyTorch-based KAN model on CPU, and converted from logits to a survival probability with `torch.softmax`. The JSON response returns `Predicted` plus `Survival probability`.

Prediction form

Passenger data input