GithubHelp home page GithubHelp logo

titanic-classification's Introduction

Titanic-Survival-Prediction

Hello Everyone,

Here is My Classification Project based on Predicting Survival of Passengers.

Dataset

I used Titanic Dataset avaliable on Kaggle.

Link to the Dataset : Titanic Dataset

Problem Statement

  • The sinking of the Titanic is one of the most infamous shipwrecks in history.

  • On April 15, 1912, during her maiden voyage, the widely considered “unsinkable” RMS Titanic sank after colliding with an iceberg.

  • Unfortunately, there weren’t enough lifeboats for everyone onboard, resulting in the death of 1502 out of 2224 passengers and crew.

  • While there was some element of luck involved in surviving, it seems some groups of people were more likely to survive than others.

  • In this challenge, we have to build a predictive model that answers the question : “what sorts of people were more likely to survive?” using Passenger Data.

Table of Contents

Setting up the Enviroment

Jupyter Notebook is required for this project and you can install and set it up in the terminal.

  • Install the jupyter notebook - pip install jupyter notebook

  • Run the Notebook - jupyter notebook

Libraries required for the Project

NumPy

  • Go to Terminal and run this code - pip install numpy

  • Go to Jupyter Notebook and run this code from a cell - !pip install numpy

Pandas

  • Go to Terminal and run this code - pip install pandas

  • Go to Jupyter Notebook and run this code from a cell - !pip install pandas

Matplotlib

  • Go to Terminal and run this code - pip install matplotlib

  • Go to Jupyter Notebook and run this code from a cell - !pip install matplotlib

Sklearn

  • Go to Terminal and run this code - pip install sklearn

  • Go to Jupyter Notebook and run this code from a cell - !pip install sklearn

Getting Started

  • Clone the repository to your local machine using the following command :
git clone https://github.com/HiteshNP/Titanic-Classification.git

Steps involved in the Project

Data Cleaning

  • Removing Null Values in the Age Columns and replacing them with Mean Age by using fillna().mean().

  • Dropping Cabin Columns as it contains Many Null Values.

  • Dropping Text Columns from our Dataset because our Model only works on Numerical Data.

  • Creating Dummies Value for Sex Column and Converting it into a DataFrame and Concatenating it with Orignal DataFrame.

Model Building

  • Firstly I have defined Dependent and Independent Variables for our Traning and Testing.

  • I have splitted data into Traning and Testing Set by using Train Test Split.

  • Then I Trained the Model with X_train and y_train and checked the Score.

  • And Finally I predicted the Result from my Trained Model.

Conclusion

  • In conclusion, the Titanic Survival Prediction Project was an exciting endeavor where I applied Logistic Regression, Support Vector Machines, Naive Bayes, KNN and Decision Tree to predict the survival of passengers aboard the Titanic.

  • The Naive Bayes model achieved Accuracy Score:0.7686,
    Logistic Regression model achieved Accuracy Score:0.7611,
    Decision Tree model achieved Accuracy Score: 0.7425,
    Support Vector Machines model achieved Accuracy Score:0.6604,
    KNN model achieved Accuracy Score:0.6604, indicating a reasonably good level of accuracy in predicting survival outcomes.

  • Therefore, by employing a Naive Bayes model, one can attain the highest level of accuracy when predicting survival outcomes.

Link to the Notebook:

Titanic Survival Prediction

titanic-classification's People

Contributors

hiteshnp avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.