TITANIC DATASET

Let us now run the NaiveBayes classifier on the Titanic dataset.

All of us know about the fateful ship that sank in the North Atlantic Ocean.

Let us try to find the probability that a person (based on Class, Sex and Age) on the ship actually survived!!

The data is made up of the following attributes.

  • To know more about the dataset
    > ?Titanic

  • View the Titanic Dataset
    > View(Titanic)

  • Check if there were higher survival rates in females. The 3rd column is the index of the Gender feature - Female or Male, and the 4th column indicates the Survival- Yes / No.

    apply(Titanic, c(2, 4), sum)

SEX SURVIVED: YES? SURVIVED: NO?
MALE 1364 367
FEMALE 126 344

Clearly females were not as lucky as males.

Check if there were higher survival rates in children.

HINT: The 3rd column is the index of the Age feature - Child or Adult, and the 4th column indicates the Survival - Yes / No.


results matching ""

    No results matching ""