Kaggle-titanic - A tutorial for Kaggle's Titanic: Machine Learning from Disaster competition. Demonstrates basic data munging, analysis, and visualization techniques. Shows examples of supervised machine learning techniques.

Overview

Kaggle-titanic

This is a tutorial in an IPython Notebook for the Kaggle competition, Titanic Machine Learning From Disaster. The goal of this repository is to provide an example of a competitive analysis for those interested in getting into the field of data analytics or using python for Kaggle's Data Science competitions .

Quick Start: View a static version of the notebook in the comfort of your own web browser.

Installation:

To run this notebook interactively:

  1. Download this repository in a zip file by clicking on this link or execute this from the terminal: git clone https://github.com/agconti/kaggle-titanic.git
  2. Install virtualenv.
  3. Navigate to the directory where you unzipped or cloned the repo and create a virtual environment with virtualenv env.
  4. Activate the environment with source env/bin/activate
  5. Install the required dependencies with pip install -r requirements.txt.
  6. Execute ipython notebook from the command line or terminal.
  7. Click on Titanic.ipynb on the IPython Notebook dasboard and enjoy!
  8. When you're done deactivate the virtual environment with deactivate.

Dependencies:

Kaggle Competition | Titanic Machine Learning from Disaster

The sinking of the RMS Titanic is one of the most infamous shipwrecks in history. On April 15, 1912, during her maiden voyage, the Titanic sank after colliding with an iceberg, killing 1502 out of 2224 passengers and crew. This sensational tragedy shocked the international community and led to better safety regulations for ships.

One of the reasons that the shipwreck led to such loss of life was that there were not enough lifeboats for the passengers and crew. Although there was some element of luck involved in surviving the sinking, some groups of people were more likely to survive than others, such as women, children, and the upper-class.

In this contest, we ask you to complete the analysis of what sorts of people were likely to survive. In particular, we ask you to apply the tools of machine learning to predict which passengers survived the tragedy.

This Kaggle Getting Started Competition provides an ideal starting place for people who may not have a lot of experience in data science and machine learning."

From the competition homepage.

Goal for this Notebook:

Show a simple example of an analysis of the Titanic disaster in Python using a full complement of PyData utilities. This is aimed for those looking to get into the field or those who are already in the field and looking to see an example of an analysis done with Python.

This Notebook will show basic examples of:

Data Handling

  • Importing Data with Pandas
  • Cleaning Data
  • Exploring Data through Visualizations with Matplotlib

Data Analysis

  • Supervised Machine learning Techniques: + Logit Regression Model + Plotting results + Support Vector Machine (SVM) using 3 kernels + Basic Random Forest + Plotting results

Valuation of the Analysis

  • K-folds cross validation to valuate results locally
  • Output the results from the IPython Notebook to Kaggle

Benchmark Scripts

To find the basic scripts for the competition benchmarks look in the "Python Examples" folder. These scripts are based on the originals provided by Astro Dave but have been reworked so that they are easier to understand for new comers.

Competition Website: http://www.kaggle.com/c/titanic-gettingStarted

Comments
  • output file

    output file "data/output/logitregres.csv" contains the survived values other than {0,1}

    Thanks for the great article and code. I see that direct submission of output file to kaggle results in error and it says Survived column values must be either 0 or 1.

    Am I missing something? Should I have a cutoff and turn them in to 0 or 1?

    opened by srini09 2
  • Fixed issue with bar chart

    Fixed issue with bar chart

    If auto-sorting is on (as per default), the returned series object is sorted by values, i.e. for „male“ the not-survived category is reported first and for „female“ the survived. When summing over male and female, the categories get mixed up.

    opened by metatier 2
  • Adds the updated csv files with capitalied column names. Fixed the iPyth...

    Adds the updated csv files with capitalied column names. Fixed the iPyth...

    ...on Notebook so it works with capitalized column headers. Updated the data folder with the two new csv files (train and test) as well as output/logitregres.csv.

    opened by thearpitgupta 2
  • Column headers are now capitalized

    Column headers are now capitalized

    Looks like column headers in the training data set are now capitalized. See here http://www.kaggle.com/c/titanic-gettingStarted/download/train.csv It's not capitalized in the data set used used in the repo https://github.com/agconti/kaggle-titanic/blob/master/data/train.csv Wonder if Kaggle changed the data set and intentionally made this change. Anyways, if you want I am happy to submit a PR that works with capitalized column names. Let me know. Thanks.

    PS - Great work.

    opened by thearpitgupta 2
  • sharey for subplots

    sharey for subplots

    Not sure if you're original intention was to show the Y axis for all your subplots in input 14 but if it wasn't you can pass in sharey=True into df.plot() function to eliminate the redundant axes.

    example

    Awesome work on the notebook btw!

    opened by zunayed 2
  • Install KaggleAux through pip

    Install KaggleAux through pip

    Currently, a subsection of KaggleAux is included in this repository as a temporary connivence. It would be cleaner to have KaggleAux as a 3rd party dependency installed through pip. This would be less confusing to users, and would allow updates in KaggleAux to be better incorporated.

    enhancement 
    opened by agconti 1
  • Categorization of algorithms

    Categorization of algorithms

    The README and several places in notebook categorize SVM and Random Forest into "Unsupervised Learning". They actually belong to "Supervised Learning".

    e.g. http://cs229.stanford.edu/notes/cs229-notes3.pdf

    opened by hupili 1
  • Suggestion -- update requirements.txt

    Suggestion -- update requirements.txt

    Hi, I don't know if this repo is still maintained, but would be nice to update the requirements.txt with supported versions.

    :+1: Thanks for putting this repo together.

    opened by DaveOkpare 0
  • Update agc_simp_gendermodel.py

    Update agc_simp_gendermodel.py

    data indexing was inappropriate for the operation taking care Lines #18,#19 index 3 , we have Name of passenger but not gender , so all the time we'll get false
    Lines #26,#27,#28 , proportions should be calculated on Survived column , not on PassengerId

    opened by praveenbommali 0
  • why use barh and ylim

    why use barh and ylim

    I don't understand the need of using barh and ylim functions in plotting.Simple vertical graphs are easier to understand then what is the purpose of using barh.And Thank you for sharing this notebook it's really informative.

    opened by barotdhrumil21 0
Releases(v0.2.0)
Official PyTorch implementation of Spatial Dependency Networks.

Spatial Dependency Networks: Neural Layers for Improved Generative Image Modeling Đorđe Miladinović   Aleksandar Stanić   Stefan Bauer   Jürgen Schmid

Djordje Miladinovic 34 Jan 19, 2022
BTC-Generator - BTC Generator With Python

Что такое BTC-Generator? Это генератор чеков всеми любимого @BTC_BANKER_BOT Для

DoomGod 3 Aug 24, 2022
Code and description for my BSc Project, September 2021

BSc-Project Disclaimer: This repo consists of only the additional python scripts necessary to run the agent. To run the project on your own personal d

Matin Tavakoli 20 Jul 19, 2022
Pytorch implementation of NeurIPS 2021 paper: Geometry Processing with Neural Fields.

Geometry Processing with Neural Fields Pytorch implementation for the NeurIPS 2021 paper: Geometry Processing with Neural Fields Guandao Yang, Serge B

Guandao Yang 162 Dec 16, 2022
Fuzzification helps developers protect the released, binary-only software from attackers who are capable of applying state-of-the-art fuzzing techniques

About Fuzzification Fuzzification helps developers protect the released, binary-only software from attackers who are capable of applying state-of-the-

gts3.org (<a href=[email protected])"> 55 Oct 25, 2022
MSG-Transformer: Exchanging Local Spatial Information by Manipulating Messenger Tokens

MSG-Transformer Official implementation of the paper MSG-Transformer: Exchanging Local Spatial Information by Manipulating Messenger Tokens, by Jiemin

Hust Visual Learning Team 68 Nov 16, 2022
An image classification app boilerplate to serve your deep learning models asap!

Image 🖼 Classification App Boilerplate Have you been puzzled by tons of videos, blogs and other resources on the internet and don't know where and ho

Smaranjit Ghose 27 Oct 06, 2022
Deep Anomaly Detection with Outlier Exposure (ICLR 2019)

Outlier Exposure This repository contains the essential code for the paper Deep Anomaly Detection with Outlier Exposure (ICLR 2019). Requires Python 3

Dan Hendrycks 464 Dec 27, 2022
A Deep Learning Based Knowledge Extraction Toolkit for Knowledge Base Population

DeepKE is a knowledge extraction toolkit supporting low-resource and document-level scenarios for entity, relation and attribute extraction. We provide comprehensive documents, Google Colab tutorials

ZJUNLP 1.6k Jan 05, 2023
Adversarial examples to the new ConvNeXt architecture

Adversarial examples to the new ConvNeXt architecture To get adversarial examples to the ConvNeXt architecture, run the Colab: https://github.com/stan

Stanislav Fort 19 Sep 18, 2022
Code for Fold2Seq paper from ICML 2021

[ICML2021] Fold2Seq: A Joint Sequence(1D)-Fold(3D) Embedding-based Generative Model for Protein Design Environment file: environment.yml Data and Feat

International Business Machines 43 Dec 04, 2022
UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation

UnivNet UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation. Training python train.py --c

Rishikesh (ऋषिकेश) 55 Dec 26, 2022
K Closest Points and Maximum Clique Pruning for Efficient and Effective 3D Laser Scan Matching (To appear in RA-L 2022)

KCP The official implementation of KCP: k Closest Points and Maximum Clique Pruning for Efficient and Effective 3D Laser Scan Matching, accepted for p

Yu-Kai Lin 109 Dec 14, 2022
CM-NAS: Cross-Modality Neural Architecture Search for Visible-Infrared Person Re-Identification (ICCV2021)

CM-NAS Official Pytorch code of paper CM-NAS: Cross-Modality Neural Architecture Search for Visible-Infrared Person Re-Identification in ICCV2021. Vis

JDAI-CV 40 Nov 25, 2022
ICCV2021 - Mining Contextual Information Beyond Image for Semantic Segmentation

Introduction The official repository for "Mining Contextual Information Beyond Image for Semantic Segmentation". Our full code has been merged into ss

55 Nov 09, 2022
PyTorch implementation of "Learn to Dance with AIST++: Music Conditioned 3D Dance Generation."

Learn to Dance with AIST++: Music Conditioned 3D Dance Generation. Installation pip install -r requirements.txt Prepare Dataset bash data/scripts/pre

Zj Li 8 Sep 07, 2021
Old Photo Restoration (Official PyTorch Implementation)

Bringing Old Photo Back to Life (CVPR 2020 oral)

Microsoft 11.3k Dec 30, 2022
OpenMMLab Image and Video Editing Toolbox

Introduction MMEditing is an open source image and video editing toolbox based on PyTorch. It is a part of the OpenMMLab project. The master branch wo

OpenMMLab 3.9k Jan 04, 2023
PyTorch implementations of deep reinforcement learning algorithms and environments

Deep Reinforcement Learning Algorithms with PyTorch This repository contains PyTorch implementations of deep reinforcement learning algorithms and env

Petros Christodoulou 4.7k Jan 04, 2023
This is an official implementation for "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows" on Semantic Segmentation.

Swin Transformer for Semantic Segmentation of satellite images This repo contains the supported code and configuration files to reproduce semantic seg

23 Oct 10, 2022