특성 탐색
동일한 Avazu 데이터세트를 사용해 device_type과 banner_pos 값의 분포를 살펴보고, 이에 따라 CTR이 어떻게 달라지는지도 탐색해 보세요.
샘플 데이터는 DataFrame 형태로 df에 로드되어 있습니다. 이전 연습 문제에서 생성한 X와 y 변수도 워크스페이스에 있습니다. pandas는 pd로도 사용할 수 있습니다.
이 연습은 강의의 일부입니다
Python으로 Machine Learning을 활용한 CTR 예측
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Distribution of values for device type
print("Distribution of device type: ")
print(X.device_type.____()/len(X))
# Sample CTR by device type
print("CTR by device type: ")
print(df.____('device_type')['click'].____/len(y))