본문 바로가기

Kaggle

(9)
Kaggle - train, test를 한꺼번에 전처리하기 pd.concat을 이용해서 train과 test를 붙인 뒤 전처리를 완료하고 다시 인덱스를 이용해서 분리한다. 전처리할 때, test의 정보를 이용해서 train 넣으면 안된다. (평균으로 결측값 넣기 등) 데이터 출처 https://www.kaggle.com/c/bike-sharing-demand/data 위 Kaggle의 데이터를 이용한다. 데이터 불러오기 train train의 레코드 개수는 총 10,886개이며 인덱스는 0부터 10885까지로 되어있다. test test 데이터셋 또한 레코드는 총 6,493개이며 인덱스는 0부터 6492까지로 구성 되어있다. pd.concat axis=0으로 concat을 하면 행이 연결된다. 총 17,379개로 만들어지며 합치더라도 인덱스는 그대로 유지된다. ..
Kaggle - Bike Sharing Demand : Fit, Predict (Random Forest) https://steadiness-193.tistory.com/229 Kaggle - Bike Sharing Demand : EDA & Feature Engineering (2) https://steadiness-193.tistory.com/228 Kaggle - Bike Sharing Demand : EDA & Feature Engineering 데이터 출처 https://www.kaggle.com/c/bike-sharing-demand/data 컬럼 설명 자료형 datetime 일시 연-월-일.. steadiness-193.tistory.com 위 포스팅에서 전처리 완료한 feature들과 https://steadiness-193.tistory.com/231 Kaggle - Bike Sharing D..
Kaggle - Bike Sharing Demand : Hyperparameter Tuning (하이퍼파라미터 튜닝) https://steadiness-193.tistory.com/230 Kaggle - Bike Sharing Demand : Evaluation (Random Forest, Cross-validation) https://steadiness-193.tistory.com/228 Kaggle - Bike Sharing Demand : EDA & Feature Engineering 데이터 출처 https://www.kaggle.com/c/bike-sharing-demand/data 컬럼 설명 자료형 datetime 일시 연-월-일.. steadiness-193.tistory.com 위 포스팅에서 만들어낸 내용을 토대로 랜덤포레스트의 옵션들인, 하이퍼파라미터의 적절한 값을 찾아보자. [Coarse Search] ..
Kaggle - Bike Sharing Demand : Evaluation (Random Forest, Cross-validation) https://steadiness-193.tistory.com/228 Kaggle - Bike Sharing Demand : EDA & Feature Engineering 데이터 출처 https://www.kaggle.com/c/bike-sharing-demand/data 컬럼 설명 자료형 datetime 일시 연-월-일 시:분:초 object season 계절 1: 봄 / 2: 여름 / 3: 가을 / 4: 겨울 int64 holiday 휴일 1: 휴일 / 0:.. steadiness-193.tistory.com https://steadiness-193.tistory.com/229 Kaggle - Bike Sharing Demand : EDA & Feature Engineering (2) https://..
Kaggle - Bike Sharing Demand : EDA & Feature Engineering (2) https://steadiness-193.tistory.com/228 Kaggle - Bike Sharing Demand : EDA & Feature Engineering 데이터 출처 https://www.kaggle.com/c/bike-sharing-demand/data 컬럼 설명 자료형 datetime 일시 연-월-일 시:분:초 object season 계절 1: 봄 / 2: 여름 / 3: 가을 / 4: 겨울 int64 holiday 휴일 1: 휴일 / 0:.. steadiness-193.tistory.com 위 포스팅과 연결됩니다. 온도 및 체감온도 1. 온도와 체감온도는 비례하는 경향을 나타내고 있다. 2. size에 count를 넣어서 보니, 온도와 체감온도가 낮을 때보다 높을 때 자전거 대여량..
Kaggle - Bike Sharing Demand : EDA & Feature Engineering 데이터 출처 https://www.kaggle.com/c/bike-sharing-demand/data 컬럼 설명 자료형 datetime 일시 연-월-일 시:분:초 object season 계절 1: 봄 / 2: 여름 / 3: 가을 / 4: 겨울 int64 holiday 휴일 1: 휴일 / 0: 휴일 아님 int64 workingday 근무일 1: 근무일 / 0: 근무일 아님 int64 weather 날씨 1: 아주 깨끗한 날씨 ~ 4: 아주 많은 비 int64 temp 온도 섭씨로 표현됨 float64 atemp 체감온도 섭씨로 표현됨 float64 humidity 습도 float64 windspeed 풍속 int64 casual 비회원의 자전거 대여량 int64 registered 회원의 자전거 대여량..
Kaggle - titanic(타이타닉) : Modeling (Decision Tree) https://steadiness-193.tistory.com/208 Kaggle - titanic(타이타닉) : Feature Engineering https://steadiness-193.tistory.com/207 Kaggle - titanic(타이타닉) : EDA 데이터 출처 https://www.kaggle.com/c/titanic/data 컬럼 설명 자료형 Survived 0이면 사망, 1이면 생존 int64 Pclass 티켓 등급 : 1,.. steadiness-193.tistory.com 위 포스팅에서 전처리 완료한 train과 test를 이용해서 생존자를 예측해보자 지도 학습 - Supervised Learning 예측에 이용할 컬럼 (feature names) : label을 맞추는데 ..
Kaggle - titanic(타이타닉) : Feature Engineering https://steadiness-193.tistory.com/207 Kaggle - titanic(타이타닉) : EDA 데이터 출처 https://www.kaggle.com/c/titanic/data 컬럼 설명 자료형 Survived 0이면 사망, 1이면 생존 int64 Pclass 티켓 등급 : 1, 2, 3 int64 Name 승객 이름 : 성, 호칭. 이름 Surname, Title. Firstname ob.. steadiness-193.tistory.com 위에서 분석한 대로 컬럼을 전처리 해주자 성별 train과 test를 한번씩 해주긴 귀찮으니 for 구문을 이용한다. 또한 lambda 함수에서 조건문을 이용해서 여자 승객일 경우 1을, 남자일 경우 0으로 치환해준다. Name - Title..