Naïve Bayes Classifier for Titanic Dataset

Uses a Multinomial Naïve Bayes model to predict passengers’ embarkation port from key demographic and fare features.

Python 3 Jupyter Notebook LabelEncoder train_test_split MultinomialNB metrics
Back to Projects

Project Overview

The project loads the Titanic CSV, fills missing values (Age, Fare, Embarked) using medians to avoid warnings, and label-encodes categorical data. It selects features (Pclass, Sex, Age, SibSp, Parch, Fare) with the target set to “Embarked.” After splitting into train/test sets, it trains a MultinomialNB classifier and evaluates performance via accuracy, confusion matrix, and classification report .

Project Files

HTML File

Project Details

  • Completion Date June 2024
  • Category Machine Learning
  • Project Type HTML File

Project Preview

Naïve Bayes Classifier for Titanic Dataset