Titanic Survival Predictor

This model predicts whether a passenger survived the Titanic disaster based on their passenger information.

Model Details

  • Model Type: XGBoost Classifier
  • Task: Binary Classification (Survived vs Died)
  • Dataset: lewtun/titanic (Kaggle Titanic dataset)
  • Features: Pclass, Sex, Age, SibSp, Parch, Fare, Embarked, FamilySize, IsAlone, Title, AgeBin, FareBin

Performance Metrics (Validation Set)

Metric Value
Accuracy 0.8156
F1 Score 0.7481
Precision 0.7903
Recall 0.7101

Feature Importance

The most important features for prediction are:

  1. Sex (26.1%) - Gender is the strongest predictor
  2. Title (20.2%) - Social status from name
  3. Pclass (11.1%) - Passenger class
  4. SibSp (8.6%) - Siblings/spouses aboard

How to Use

import pickle

with open("titanic_xgb_model.pkl", "rb") as f:
    data = pickle.load(f)
    model = data["model"]
    le_sex = data["le_sex"]
    le_embarked = data["le_embarked"]
    le_title = data["le_title"]

# See inference.py for full prediction function

Limitations

  • Model trained on historical Titanic data only
  • May not generalize to other maritime disasters
  • Missing values are imputed with median/mode values

Citation

Dataset: https://huggingface.co/datasets/lewtun/titanic

Generated by ML Intern

This model repository was generated by ML Intern, an agent for machine learning research and development on the Hugging Face Hub.

Downloads last month
-
Safetensors
Model size
67M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train muhammadmaaz724/titanic-survival-predictor