This repository contains an analysis of the Titanic using Decision Trees in R. The project demonstrates how to preprocess data, build a decision tree model & visualize it.
A Decision Tree is a supervised machine learning algorithm used for classification and regression tasks. It models decisions based on feature values, splitting data into branches at each node. Read More
The dataset used is a cleaned version of the Titanic dataset from Kaggle. It contains the following features:
Survived
: Survival status (0 = No, 1 = Yes)Pclass
: Ticket class (1st, 2nd, 3rd)Sex
: Gender (Male, Female)Age
: Age of passengerSibSp
: Number of siblings/spouses aboardParch
: Number of parents/children aboardFare
: Ticket fare
To run this project, ensure you have R and RStudio installed.
- Clone the respository:
https://github.com/DeeptejD/Decision-Trees-in-R
- Open decision_tree.R in RStudio.
- Run the script to:
- Load and preprocess the Titanic dataset.
- Train a decision tree model.
- Visualize the decision tree.
- Evaluate model performance.
Decision Tree Classification Clearly Explained - Normalized Nerd (YouTube)