Titanic – Machine Learning from Disaster kaggleリンク
タスク :分類
目的 :乗客が生き残ったかどうかを予測
評価指標:accuracy
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 ask you to build a predictive model that answers the question: “what sorts of people were more likely to survive?” using passenger data (ie name, age, gender, socio-economic class, etc).
# 使用するライブラリ import pandas as pd import numpy as np pd.plotting.register_matplotlib_converters() # to handle "datetime" type import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns from sklearn.preprocessing import LabelEncoder from sklearn.model_selection import train_test_split, GridSearchCV, KFold, StratifiedKFold, cross_val_score from sklearn.ensemble import RandomForestClassifier as RFC from sklearn.metrics import confusion_matrix, classification_report import xgboost as xgb import lightgbm as lgb import catboost