관리 메뉴

미래기술연구소

Titanic Prediction_데이터 분석 본문

카테고리 없음

Titanic Prediction_데이터 분석

I s a a c 2020. 10. 14. 20:28
728x90
반응형

 

일단 제대로 데이터 분석을 하기 전에 캐글에서 제공되는 Data Dictionary를 살펴 보자.
SipSp Parch같이 변수명의 의미을 바로 알 수가 없을 때나, Categorical feature의 변수값의 의미를 얻을 때 도움이 된다.

캐글 데이터 설명부터 확인해보자

www.kaggle.com/c/titanic/data

 

Titanic: Machine Learning from Disaster

Start here! Predict survival on the Titanic and get familiar with ML basics

www.kaggle.com

Data Dictionary

Variable Definition Key
survival Survival 0 = No, 1 = Yes
pclass Ticket class 1 = 1st, 2 = 2nd, 3 = 3rd
sex Sex  
Age Age in years  
sibsp # of siblings / spouses aboard the Titanic  
parch # of parents / children aboard the Titanic  
ticket Ticket number  
fare Passenger fare  
cabin Cabin number  
embarked Port of Embarkation C = Cherbourg, Q = Queenstown, S = Southampton

Variable Notes

Pclass: A proxy for socio-economic status (SES) 1st = Upper 2nd = Middle 3rd = Lower

Age: Age is fractional if less than 1. If the age is estimated, is it in the form of xx.5

SibSp: The dataset defines family relations in this way…
Sibling = brother, sister, stepbrother, stepsister
Spouse = husband, wife (mistresses and fiancés were ignored)

Parch: The dataset defines family relations in this way…
Parent = mother, father
Child = daughter, son, stepdaughter, stepson
Some children travelled only with a nanny, therefore parch=0 for them.

몇개만 정리해보면

Survived는 생존 여부 ( 0 = 사망 , 1 = 생존 / Train dataframe 에만 존재 )
Pclass는 좌석 등급
SibSp는 배우자, 현제 자매 총 인원
Parch는 부모님, 자녀 총 인원
Fare는 요금
Cabin는 객실 번호
Embarked는 탑승 선착장 C = Cherbourg, Q = Queenstown, S = Southampton

 

자 이제 대충 뭐가 뭔지 알았으니 데이터분석을 시작해보자

.info( ) 함수를 이용하여
한눈에 데이터의 모든 정보를 확인할수 있다

train.info ( )

자세히 보면 데이터 개수가 891개가 정상인데
Age 같은 경우 714개
Cabin 같은 경우 204 개
Embarked 는 889 개가 있는 것을 확인 할 수 있다

쉽게 말해 데이터가 없다

test.info ( )

test 데이터 또한 개수가 418개가 정상인데
Age 같은 경우 332개
Fare 같은 경우 417 개
Cabin 는 91 개가 있는 것을 확인 할 수 있다

 

728x90
반응형