ML·DL/Kaggle

Titanic - Machine Learning from Disaster

210B 2023. 2. 1. 19:26

Overview of How Kaggle’s Competitions Work

1. Join the Competition

Read about the challenge description, accept the Competition Rules and gain access to the competition dataset.

2. Get to Work

Download the data, build models on it locally or on Kaggle Kernels (our no-setup, customizable Jupyter Notebooks environment with free GPUs) and generate a prediction file.

3. Make a Submission

Upload your prediction as a submission on Kaggle and receive an accuracy score.

4. Check the Leaderboard

See how your model ranks against other Kagglers on our leaderboard.

5. Improve Your Score

Check out the discussion forum to find lots of tutorials and insights from other competitors.

 

Kaggle 챌린지 시작하기

1. accept the rules& join the competition

2. download the data(from the data tab of the competition page)

3. understand the problem

4. exploratory data analysis

5. train, tune and ensemble machine learning models

6. upload your prediction as a submission on Kaggle and receive an accuracy score

https://youtu.be/8yZMXCaFshs

 

점수 올리기

1. learn more about the data

2. experiment

 a. design/create some new features

 b. try different preprocessing

 c. try different types of ML models

 d. combine multiple models (ensemble)

3. learn from other's code and ideas



분석 진행은 캐글 노트북으로 했다. 이유는 그냥 주피터랑 비슷해보이는데 제출하기 편할것 같아서

alexis tutorial 따라함

 

loc 함수로 여성인 경우 생존 여부를 추출한 뒤 생존 여부 변수 값의 합과 여성의 수를 이용하여 생존율을 구함.

성별에 따라 생존율에 큰 차이가 있어보이는 것을 알 수 있다.

 

최종적으로 티켓 클래스, 성별, 동승한 형제자매수, 동승한 부모자식수를 선택해 예측을 진행했다.

 


  • get_dummies : 범주형 변수에 사용 가능한 함수, 변수를 컬럼으로 만들고 변수의 값을 이진으로 나타내줌

  • RandomForestClassifier : 기본 결정트리의 과적합 현상을 개선하기 위해 앙상블 기법으로 고안된 것으로 다수의 결정 트리들을 랜덤하게 학습시켜 분류 또는 회귀의 결과 도출에 사용됨

 

💡 RandomForestClassifier 추가 학습 필요